mirror of
https://github.com/kilyabin/psysonic.git
synced 2026-07-21 22:15:40 +00:00
chore(orbit): confirm dialog before host ends a running session
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -96,10 +96,11 @@ export default function OrbitSessionBar() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onExit = () => {
|
const onExit = () => {
|
||||||
// Guests in an active session get a confirm — leaving is voluntary and
|
// Active-session exits get a confirm — guests don't want to drop out on
|
||||||
// a fat-finger shouldn't drop them out. Host-end and post-end/kicked
|
// a fat-finger, and the host's X ends the session for everyone, so
|
||||||
// dismissals exit immediately (the session is already over there).
|
// accidentally clicking it is even worse. Post-end/kicked dismissals
|
||||||
if (role === 'guest' && phase === 'active') {
|
// skip the confirm (the session is already over there).
|
||||||
|
if (phase === 'active' && (role === 'guest' || role === 'host')) {
|
||||||
setConfirmLeave(true);
|
setConfirmLeave(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -239,10 +240,17 @@ export default function OrbitSessionBar() {
|
|||||||
<OrbitExitModal />
|
<OrbitExitModal />
|
||||||
<ConfirmModal
|
<ConfirmModal
|
||||||
open={confirmLeave}
|
open={confirmLeave}
|
||||||
title={t('orbit.confirmLeaveTitle')}
|
title={role === 'host'
|
||||||
message={t('orbit.confirmLeaveBody', { name: state.name, host: state.host })}
|
? t('orbit.confirmEndTitle')
|
||||||
confirmLabel={t('orbit.confirmLeaveConfirm')}
|
: t('orbit.confirmLeaveTitle')}
|
||||||
|
message={role === 'host'
|
||||||
|
? t('orbit.confirmEndBody', { name: state.name })
|
||||||
|
: t('orbit.confirmLeaveBody', { name: state.name, host: state.host })}
|
||||||
|
confirmLabel={role === 'host'
|
||||||
|
? t('orbit.confirmEndConfirm')
|
||||||
|
: t('orbit.confirmLeaveConfirm')}
|
||||||
cancelLabel={t('orbit.confirmCancel')}
|
cancelLabel={t('orbit.confirmCancel')}
|
||||||
|
danger={role === 'host'}
|
||||||
onConfirm={() => { setConfirmLeave(false); void performExit(); }}
|
onConfirm={() => { setConfirmLeave(false); void performExit(); }}
|
||||||
onCancel={() => setConfirmLeave(false)}
|
onCancel={() => setConfirmLeave(false)}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -1511,6 +1511,9 @@ export const deTranslation = {
|
|||||||
confirmLeaveTitle: 'Session verlassen?',
|
confirmLeaveTitle: 'Session verlassen?',
|
||||||
confirmLeaveBody: '„{{name}}" wirklich verlassen? Du kannst jederzeit über {{host}}s Einladungslink wieder beitreten.',
|
confirmLeaveBody: '„{{name}}" wirklich verlassen? Du kannst jederzeit über {{host}}s Einladungslink wieder beitreten.',
|
||||||
confirmLeaveConfirm: 'Verlassen',
|
confirmLeaveConfirm: 'Verlassen',
|
||||||
|
confirmEndTitle: 'Session für alle beenden?',
|
||||||
|
confirmEndBody: '„{{name}}" wird für alle Teilnehmer geschlossen. Die Session-Playlists werden automatisch aufgeräumt.',
|
||||||
|
confirmEndConfirm: 'Session beenden',
|
||||||
invalidLinkTitle: 'Einladungslink ist nicht mehr gültig',
|
invalidLinkTitle: 'Einladungslink ist nicht mehr gültig',
|
||||||
invalidLinkBody: 'Diese Orbit-Session existiert nicht mehr oder wurde bereits beendet. Bitte den Gastgeber um einen neuen Einladungslink.',
|
invalidLinkBody: 'Diese Orbit-Session existiert nicht mehr oder wurde bereits beendet. Bitte den Gastgeber um einen neuen Einladungslink.',
|
||||||
settingsTitle: 'Session-Einstellungen',
|
settingsTitle: 'Session-Einstellungen',
|
||||||
|
|||||||
@@ -1514,6 +1514,9 @@ export const enTranslation = {
|
|||||||
confirmLeaveTitle: 'Leave session?',
|
confirmLeaveTitle: 'Leave session?',
|
||||||
confirmLeaveBody: 'Leave "{{name}}"? You can re-join via {{host}}\'s invite link any time.',
|
confirmLeaveBody: 'Leave "{{name}}"? You can re-join via {{host}}\'s invite link any time.',
|
||||||
confirmLeaveConfirm: 'Leave',
|
confirmLeaveConfirm: 'Leave',
|
||||||
|
confirmEndTitle: 'End session for everyone?',
|
||||||
|
confirmEndBody: '"{{name}}" will close for all participants. The session\'s playlists are cleaned up automatically.',
|
||||||
|
confirmEndConfirm: 'End session',
|
||||||
invalidLinkTitle: 'Invite link is no longer valid',
|
invalidLinkTitle: 'Invite link is no longer valid',
|
||||||
invalidLinkBody: 'This Orbit session doesn\'t exist any more or has already ended. Ask the host for a fresh invite link.',
|
invalidLinkBody: 'This Orbit session doesn\'t exist any more or has already ended. Ask the host for a fresh invite link.',
|
||||||
settingsTitle: 'Session settings',
|
settingsTitle: 'Session settings',
|
||||||
|
|||||||
Reference in New Issue
Block a user