Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? 🤔

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because in prod, we (Jitsi) build in chunks for performance. Now in prod, there are a bunch of errors because of chunks not being found (because the chunks folder is not copied). All works, because it falls back to serving the entier file I think, but still complains a lot:
Screenshot 2026-05-22 at 15 57 38

mkdir -p $(DEPLOY_DIR)/chunks; \
cp $(BUILD_DIR)/chunks/* $(DEPLOY_DIR)/chunks/; \
fi

deploy-lib-meet:
cp \
Expand Down
Binary file added images/icon-small.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/logo192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed images/logo512.png
Binary file not shown.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<meta name="theme-color" content="#2A3A4B">
<!--#include virtual="base.html" -->

<link rel="apple-touch-icon" href="images/apple-touch-icon.png">
<link rel="apple-touch-icon" href="images/icon-small.png">
<link rel="stylesheet" href="css/all.css">
<!--#include virtual="fonts.html"-->
<link rel="manifest" id="manifest-placeholder">
Expand Down
46 changes: 46 additions & 0 deletions react/features/base/meet/LocalStorageManager.test.ts
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would recommend you to use When..., then... to describe the tests and avoiding using technical words so if a variable changes, you don't need to change the test description. It would be better if you describes the functionality rather than the expected behavior of a variable/function. You know what I mean?
E.g. test('Wen calling the storage multiple times, then the same storage is returned always'... ), test('When there is no name, then nothing is stored', ...)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xabg2 Fixed

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use test instead of it. it is for should... and test to describe when..., then...

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xabg2 Done

Original file line number Diff line number Diff line change
@@ -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();
});

});
15 changes: 15 additions & 0 deletions react/features/base/meet/LocalStorageManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export class LocalStorageManager {
MNEMONIC: "xMnemonic",
USER: "xUser",
SUBSCRIPTION: "xSubscription",
DISPLAY_NAME: "xMeetDisplayName",
};

private constructor() {}
Expand Down Expand Up @@ -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<string>(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
Expand All @@ -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 {
Expand Down
23 changes: 4 additions & 19 deletions react/features/base/meet/views/PreMeeting/PreMeetingScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,10 @@ const PreMeetingScreen = ({
getUsersInMeeting();
}

if (userData?.name) {
const name = storageManager.getDisplayName() || userData?.name;
if (name) {
dispatchUpdateSettings({
displayName: userData.name,
displayName: name,
});
}
}, []);
Expand All @@ -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 = () => {
Expand Down
2 changes: 1 addition & 1 deletion static/offline.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!--#include virtual="/base.html" -->

<link rel="apple-touch-icon" href="images/apple-touch-icon.png">
<link rel="apple-touch-icon" href="images/icon-small.png">
<!--#include virtual="/title.html" -->
</head>
<style>
Expand Down
Loading