Skip to content

Commit

Permalink
fix(player): fix init notice keep showing
Browse files Browse the repository at this point in the history
  • Loading branch information
aidenlx committed Feb 16, 2024
1 parent 3a910bc commit 9890077
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions apps/app/src/lib/remote-player/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,8 @@ class WebviewLoadError extends Error {
}

function notifyLogin() {
const notified = localStorage.getItem("mx:webview-login-notified");
const label = "mx:webview-login-notified";
const notified = localStorage.getItem(label);
if (notified) return;
new Notice(
createFragment((e) => {
Expand All @@ -311,5 +312,5 @@ function notifyLogin() {
}),
0,
);
localStorage.setItem("mx:webview-login-notified", "1");
localStorage.setItem(label, "1");
}
5 changes: 3 additions & 2 deletions apps/app/src/media-view/base.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ export function titleFromUrl(src: string): string {

export function addAction(player: PlayerComponent & ItemView) {
function noticeBehavior(action: string) {
const notified = localStorage.getItem("mx:media-notetaking-notice");
const label = "mx:media-notetaking-notified";
const notified = localStorage.getItem(label);
if (notified) return;
new Notice(
createFragment((e) => {
Expand All @@ -66,7 +67,7 @@ export function addAction(player: PlayerComponent & ItemView) {
}),
0,
);
localStorage.setItem("mx:media-noting-notice", "1");
localStorage.setItem(label, "1");
}
player.addAction("star", "Timestamp", () => {
const info = player.getMediaInfo();
Expand Down

0 comments on commit 9890077

Please sign in to comment.