Skip to content

Commit 05c5ba3

Browse files
authored
fix: windows disappear when switching language in OS desktop page (casibase#1366)
1 parent 5e33b72 commit 05c5ba3

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

web/src/App.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ class App extends Component {
655655
<Route exact path="/messages" render={(props) => this.renderSigninIfNotSignedIn(<MessageListPage account={this.state.account} {...props} />)} />
656656
<Route exact path="/messages/:messageName" render={(props) => this.renderSigninIfNotSignedIn(<MessageEditPage account={this.state.account} {...props} />)} />
657657
<Route exact path="/usages" render={(props) => this.renderSigninIfNotSignedIn(<UsagePage account={this.state.account} {...props} />)} />
658-
<Route exact path="/desktop" component={(props) => <OsDesktop account={this.state.account} {...props} />} />
658+
<Route exact path="/desktop" render={(props) => <OsDesktop account={this.state.account} {...props} />} />
659659
<Route exact path="/nodes" render={(props) => this.renderSigninIfNotSignedIn(<NodeListPage account={this.state.account} {...props} />)} />
660660
<Route exact path="/nodes/:nodeName" render={(props) => this.renderSigninIfNotSignedIn(<NodeEditPage account={this.state.account} {...props} />)} />
661661
<Route exact path="/sessions" render={(props) => this.renderSigninIfNotSignedIn(<SessionListPage account={this.state.account} {...props} />)} />

web/src/OsDesktop.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import "./OsDesktop.css";
2828
import {LeftOutlined, RightOutlined} from "@ant-design/icons";
2929
import {useHistory} from "react-router-dom";
3030
import routeManager, {DynamicRouteComponent} from "./component/AppRouteManager";
31+
import {StaticBaseUrl} from "./Conf";
3132

3233
const DesktopIcon = ({name, iconType, onClick}) => {
3334
const [isHovered, setIsHovered] = useState(false);
@@ -62,7 +63,7 @@ const DesktopIcon = ({name, iconType, onClick}) => {
6263
>
6364
<div className="icon">
6465
<img
65-
src={`https://cdn.casibase.org/apps/${iconType}.svg`}
66+
src={`${StaticBaseUrl}/apps/${iconType}.svg`}
6667
alt={name}
6768
/>
6869
</div>
@@ -165,7 +166,7 @@ const Window = ({id, title, isMaximized, isMinimized, zIndex, position, onClose,
165166
}}
166167
/>
167168
</div>
168-
<div className="window-title">{title}</div>
169+
<div className="window-title">{i18next.t(`general:${title}`)}</div>
169170
<div className="window-controls">
170171
<Button size="small" onClick={(e) => {
171172
e.stopPropagation();
@@ -237,7 +238,7 @@ const OsDesktop = (props) => {
237238
const openWindow = (appType) => {
238239
const id = `window-${nextWindowId}`;
239240
const appConfig = routeManager.getAppConfig(appType);
240-
const title = i18next.t(`general:${appConfig.title}`);
241+
const title = appConfig.title;
241242
const initialRoute = `/${appType}s`;
242243

243244
const offset = (windows.length * 30) % 150;

0 commit comments

Comments
 (0)