diff --git a/Makefile b/Makefile index 30401bb7360c..d93789640e1f 100644 --- a/Makefile +++ b/Makefile @@ -51,6 +51,10 @@ deploy-init: deploy-appbundle: cp $(BUILD_DIR)/*.min.js $(DEPLOY_DIR) -cp $(BUILD_DIR)/*.min.js.map $(DEPLOY_DIR) + @if [ -d "$(BUILD_DIR)/chunks" ]; then \ + mkdir -p $(DEPLOY_DIR)/chunks; \ + cp $(BUILD_DIR)/chunks/* $(DEPLOY_DIR)/chunks/; \ + fi deploy-lib-meet: cp \ diff --git a/images/icon-small.png b/images/icon-small.png new file mode 100644 index 000000000000..ce92faab0b2c Binary files /dev/null and b/images/icon-small.png differ diff --git a/images/logo192.png b/images/logo192.png index f29327ffd6b4..6594169d50e9 100644 Binary files a/images/logo192.png and b/images/logo192.png differ diff --git a/images/logo512.png b/images/logo512.png deleted file mode 100644 index 2a7ba082dd77..000000000000 Binary files a/images/logo512.png and /dev/null differ diff --git a/index.html b/index.html index b4fb9d33ceef..c0af7eb0a937 100644 --- a/index.html +++ b/index.html @@ -7,7 +7,7 @@ - + diff --git a/react/features/base/meet/LocalStorageManager.test.ts b/react/features/base/meet/LocalStorageManager.test.ts new file mode 100644 index 000000000000..388206706f30 --- /dev/null +++ b/react/features/base/meet/LocalStorageManager.test.ts @@ -0,0 +1,46 @@ +import { beforeEach, describe, expect, test, vi } from "vitest"; +import { LocalStorageManager } from "./LocalStorageManager"; + +const MOCK_DISPlAY_NAME = "mock-display-name"; +const key = (LocalStorageManager as any)['KEYS']?.DISPLAY_NAME; + +describe("LocalStorageManager tests", () => { + beforeEach(() => { + localStorage.clear(); + vi.clearAllMocks(); + }); + + test("when local storage is called repeatedly, then the same instance is returned", () => { + const a = LocalStorageManager.instance; + const b = LocalStorageManager.instance; + expect(a).toBe(b); + }); + + test("when no display name is stored, then returns underfined", () => { + expect(LocalStorageManager.instance.getDisplayName()).toBeUndefined(); + }); + + test("when display name is stored, then returns it", () => { + LocalStorageManager.instance.setDisplayName(MOCK_DISPlAY_NAME); + expect(LocalStorageManager.instance.getDisplayName()).toBe(MOCK_DISPlAY_NAME); + }); + + test("when the stored display name was modified, then returns the last modification", () => { + LocalStorageManager.instance.setDisplayName(MOCK_DISPlAY_NAME); + const modifiedName = 'new-display-name'; + localStorage.setItem(key, modifiedName); + expect(LocalStorageManager.instance.getDisplayName()).toBe(modifiedName); + }); + + test("when display name is saved in the local storage, then it does not bleed into the session storage", () => { + LocalStorageManager.instance.setDisplayName(MOCK_DISPlAY_NAME); + expect(sessionStorage.getItem(key)).toBeNull(); + }); + + test("when local storage is cleaned, then display name becomes underfined", () => { + LocalStorageManager.instance.setDisplayName(MOCK_DISPlAY_NAME); + LocalStorageManager.instance.clearCredentials(); + expect(LocalStorageManager.instance.getDisplayName()).toBeUndefined(); + }); + +}); \ No newline at end of file diff --git a/react/features/base/meet/LocalStorageManager.ts b/react/features/base/meet/LocalStorageManager.ts index 808fc0ffca5f..9fad106fc3f3 100644 --- a/react/features/base/meet/LocalStorageManager.ts +++ b/react/features/base/meet/LocalStorageManager.ts @@ -18,6 +18,7 @@ export class LocalStorageManager { MNEMONIC: "xMnemonic", USER: "xUser", SUBSCRIPTION: "xSubscription", + DISPLAY_NAME: "xMeetDisplayName", }; private constructor() {} @@ -169,6 +170,19 @@ export class LocalStorageManager { this.remove(LocalStorageManager.KEYS.SUBSCRIPTION); } + /** + * Gets the user display name + */ + public getDisplayName(): string | null | undefined { + return this.get(LocalStorageManager.KEYS.DISPLAY_NAME); + } + + /** + * Sets the user display name + */ + public setDisplayName(displayName: string): void { + this.set(LocalStorageManager.KEYS.DISPLAY_NAME, displayName); + } /** * Saves the session credentials @@ -195,6 +209,7 @@ export class LocalStorageManager { this.remove(LocalStorageManager.KEYS.MNEMONIC); this.remove(LocalStorageManager.KEYS.USER); this.remove(LocalStorageManager.KEYS.SUBSCRIPTION); + this.remove(LocalStorageManager.KEYS.DISPLAY_NAME); } public clearStorage(): void { diff --git a/react/features/base/meet/views/PreMeeting/PreMeetingScreen.tsx b/react/features/base/meet/views/PreMeeting/PreMeetingScreen.tsx index 57647dc1f66b..0907f6f698dd 100644 --- a/react/features/base/meet/views/PreMeeting/PreMeetingScreen.tsx +++ b/react/features/base/meet/views/PreMeeting/PreMeetingScreen.tsx @@ -271,9 +271,10 @@ const PreMeetingScreen = ({ getUsersInMeeting(); } - if (userData?.name) { + const name = storageManager.getDisplayName() || userData?.name; + if (name) { dispatchUpdateSettings({ - displayName: userData.name, + displayName: name, }); } }, []); @@ -297,28 +298,12 @@ const PreMeetingScreen = ({ } }; - const updateNameInStorage = (name: string) => { - try { - const user = storageManager.getUser(); - - if (user) { - const updatedUser = { - ...user, - name: name, - }; - - storageManager.setUser(updatedUser); - } - } catch (error) { - console.error("Error updating user name in localStorage:", error); - } - }; const setName = (displayName: string) => { dispatchUpdateSettings({ displayName, }); - updateNameInStorage(displayName); + storageManager.setDisplayName(displayName); }; const onLogout = () => { diff --git a/static/offline.html b/static/offline.html index 293949eb85ce..76f4397df10e 100644 --- a/static/offline.html +++ b/static/offline.html @@ -8,7 +8,7 @@ - +