mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
fix: rerender i18n in host components on lang change (#6224)
This commit is contained in:
parent
e4506be3e8
commit
04a8c22f39
14 changed files with 88 additions and 72 deletions
|
@ -70,7 +70,7 @@ import { decryptData } from "../../data/encryption";
|
|||
import { resetBrowserStateVersions } from "../data/tabSync";
|
||||
import { LocalData } from "../data/LocalData";
|
||||
import { atom, useAtom } from "jotai";
|
||||
import { jotaiStore } from "../../jotai";
|
||||
import { appJotaiStore } from "../app-jotai";
|
||||
|
||||
export const collabAPIAtom = atom<CollabAPI | null>(null);
|
||||
export const collabDialogShownAtom = atom(false);
|
||||
|
@ -167,7 +167,7 @@ class Collab extends PureComponent<Props, CollabState> {
|
|||
setUsername: this.setUsername,
|
||||
};
|
||||
|
||||
jotaiStore.set(collabAPIAtom, collabAPI);
|
||||
appJotaiStore.set(collabAPIAtom, collabAPI);
|
||||
this.onOfflineStatusToggle();
|
||||
|
||||
if (
|
||||
|
@ -185,7 +185,7 @@ class Collab extends PureComponent<Props, CollabState> {
|
|||
}
|
||||
|
||||
onOfflineStatusToggle = () => {
|
||||
jotaiStore.set(isOfflineAtom, !window.navigator.onLine);
|
||||
appJotaiStore.set(isOfflineAtom, !window.navigator.onLine);
|
||||
};
|
||||
|
||||
componentWillUnmount() {
|
||||
|
@ -208,10 +208,10 @@ class Collab extends PureComponent<Props, CollabState> {
|
|||
}
|
||||
}
|
||||
|
||||
isCollaborating = () => jotaiStore.get(isCollaboratingAtom)!;
|
||||
isCollaborating = () => appJotaiStore.get(isCollaboratingAtom)!;
|
||||
|
||||
private setIsCollaborating = (isCollaborating: boolean) => {
|
||||
jotaiStore.set(isCollaboratingAtom, isCollaborating);
|
||||
appJotaiStore.set(isCollaboratingAtom, isCollaborating);
|
||||
};
|
||||
|
||||
private onUnload = () => {
|
||||
|
@ -804,7 +804,7 @@ class Collab extends PureComponent<Props, CollabState> {
|
|||
);
|
||||
|
||||
handleClose = () => {
|
||||
jotaiStore.set(collabDialogShownAtom, false);
|
||||
appJotaiStore.set(collabDialogShownAtom, false);
|
||||
};
|
||||
|
||||
setUsername = (username: string) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue