mirror of
https://github.com/antebudimir/feishin.git
synced 2025-12-31 18:13:31 +00:00
display private mode status
This commit is contained in:
parent
7423b71a65
commit
2271c211cb
3 changed files with 32 additions and 9 deletions
|
|
@ -288,6 +288,11 @@
|
||||||
"updateServer": {
|
"updateServer": {
|
||||||
"success": "server updated successfully",
|
"success": "server updated successfully",
|
||||||
"title": "update server"
|
"title": "update server"
|
||||||
|
},
|
||||||
|
"privateMode": {
|
||||||
|
"enabled": "private mode enabled, playback status is now hidden from external integrations",
|
||||||
|
"disabled": "private mode disabled, playback status is now visible to enabled external integrations",
|
||||||
|
"title": "private mode"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"page": {
|
"page": {
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ import {
|
||||||
} from '/@/renderer/store';
|
} from '/@/renderer/store';
|
||||||
import { DropdownMenu } from '/@/shared/components/dropdown-menu/dropdown-menu';
|
import { DropdownMenu } from '/@/shared/components/dropdown-menu/dropdown-menu';
|
||||||
import { Icon } from '/@/shared/components/icon/icon';
|
import { Icon } from '/@/shared/components/icon/icon';
|
||||||
|
import { toast } from '/@/shared/components/toast/toast';
|
||||||
import { ServerListItem, ServerType } from '/@/shared/types/domain-types';
|
import { ServerListItem, ServerType } from '/@/shared/types/domain-types';
|
||||||
|
|
||||||
const browser = isElectron() ? window.api.browser : null;
|
const browser = isElectron() ? window.api.browser : null;
|
||||||
|
|
@ -84,10 +85,18 @@ export const AppMenu = () => {
|
||||||
|
|
||||||
const handlePrivateModeOff = () => {
|
const handlePrivateModeOff = () => {
|
||||||
setPrivateMode(false);
|
setPrivateMode(false);
|
||||||
|
toast.info({
|
||||||
|
message: t('form.privateMode.disabled', { postProcess: 'sentenceCase' }),
|
||||||
|
title: t('form.privateMode.title', { postProcess: 'sentenceCase' }),
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const handlePrivateModeOn = () => {
|
const handlePrivateModeOn = () => {
|
||||||
setPrivateMode(true);
|
setPrivateMode(true);
|
||||||
|
toast.info({
|
||||||
|
message: t('form.privateMode.enabled', { postProcess: 'sentenceCase' }),
|
||||||
|
title: t('form.privateMode.title', { postProcess: 'sentenceCase' }),
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleQuit = () => {
|
const handleQuit = () => {
|
||||||
|
|
@ -139,13 +148,16 @@ export const AppMenu = () => {
|
||||||
</DropdownMenu.Item>
|
</DropdownMenu.Item>
|
||||||
{privateMode ? (
|
{privateMode ? (
|
||||||
<DropdownMenu.Item
|
<DropdownMenu.Item
|
||||||
leftSection={<Icon icon="lockOpen" />}
|
leftSection={<Icon color="error" icon="lock" />}
|
||||||
onClick={handlePrivateModeOff}
|
onClick={handlePrivateModeOff}
|
||||||
>
|
>
|
||||||
{t('page.appMenu.privateModeOff', { postProcess: 'sentenceCase' })}
|
{t('page.appMenu.privateModeOff', { postProcess: 'sentenceCase' })}
|
||||||
</DropdownMenu.Item>
|
</DropdownMenu.Item>
|
||||||
) : (
|
) : (
|
||||||
<DropdownMenu.Item leftSection={<Icon icon="lock" />} onClick={handlePrivateModeOn}>
|
<DropdownMenu.Item
|
||||||
|
leftSection={<Icon icon="lockOpen" />}
|
||||||
|
onClick={handlePrivateModeOn}
|
||||||
|
>
|
||||||
{t('page.appMenu.privateModeOn', { postProcess: 'sentenceCase' })}
|
{t('page.appMenu.privateModeOn', { postProcess: 'sentenceCase' })}
|
||||||
</DropdownMenu.Item>
|
</DropdownMenu.Item>
|
||||||
)}
|
)}
|
||||||
|
|
|
||||||
|
|
@ -12,8 +12,12 @@ import macMinHover from './assets/min-mac-hover.png';
|
||||||
import macMin from './assets/min-mac.png';
|
import macMin from './assets/min-mac.png';
|
||||||
import styles from './window-bar.module.css';
|
import styles from './window-bar.module.css';
|
||||||
|
|
||||||
import { useCurrentStatus, useQueueStatus } from '/@/renderer/store';
|
import {
|
||||||
import { useWindowSettings } from '/@/renderer/store/settings.store';
|
useAppStore,
|
||||||
|
useCurrentStatus,
|
||||||
|
useQueueStatus,
|
||||||
|
useWindowSettings,
|
||||||
|
} from '/@/renderer/store';
|
||||||
import { Text } from '/@/shared/components/text/text';
|
import { Text } from '/@/shared/components/text/text';
|
||||||
import { Platform, PlayerStatus } from '/@/shared/types/types';
|
import { Platform, PlayerStatus } from '/@/shared/types/types';
|
||||||
|
|
||||||
|
|
@ -126,14 +130,16 @@ export const WindowBar = () => {
|
||||||
const playerStatus = useCurrentStatus();
|
const playerStatus = useCurrentStatus();
|
||||||
const { currentSong, index, length } = useQueueStatus();
|
const { currentSong, index, length } = useQueueStatus();
|
||||||
const { windowBarStyle } = useWindowSettings();
|
const { windowBarStyle } = useWindowSettings();
|
||||||
|
const { privateMode } = useAppStore();
|
||||||
|
|
||||||
const statusString = playerStatus === PlayerStatus.PAUSED ? '(Paused) ' : '';
|
const statusString = playerStatus === PlayerStatus.PAUSED ? '(Paused) ' : '';
|
||||||
const queueString = length ? `(${index + 1} / ${length}) ` : '';
|
const queueString = length ? `(${index + 1} / ${length}) ` : '';
|
||||||
const title = length
|
const privateModeString = privateMode ? '(Private mode)' : '';
|
||||||
? currentSong?.artistName
|
const title = `${
|
||||||
? `${statusString}${queueString}${currentSong?.name} — ${currentSong?.artistName}`
|
length
|
||||||
: `${statusString}${queueString}${currentSong?.name}`
|
? `${statusString}${queueString}${currentSong?.name}${currentSong?.artistName ? ` — ${currentSong?.artistName}` : ''}`
|
||||||
: 'Feishin';
|
: 'Feishin'
|
||||||
|
}${privateMode ? ` ${privateModeString}` : ''}`;
|
||||||
document.title = title;
|
document.title = title;
|
||||||
|
|
||||||
const [max, setMax] = useState(localSettings?.env.START_MAXIMIZED || false);
|
const [max, setMax] = useState(localSettings?.env.START_MAXIMIZED || false);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue