mirror of
https://github.com/kilyabin/psysonic.git
synced 2026-07-22 06:25:41 +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 = () => {
|
||||
// Guests in an active session get a confirm — leaving is voluntary and
|
||||
// a fat-finger shouldn't drop them out. Host-end and post-end/kicked
|
||||
// dismissals exit immediately (the session is already over there).
|
||||
if (role === 'guest' && phase === 'active') {
|
||||
// Active-session exits get a confirm — guests don't want to drop out on
|
||||
// a fat-finger, and the host's X ends the session for everyone, so
|
||||
// accidentally clicking it is even worse. Post-end/kicked dismissals
|
||||
// skip the confirm (the session is already over there).
|
||||
if (phase === 'active' && (role === 'guest' || role === 'host')) {
|
||||
setConfirmLeave(true);
|
||||
return;
|
||||
}
|
||||
@@ -239,10 +240,17 @@ export default function OrbitSessionBar() {
|
||||
<OrbitExitModal />
|
||||
<ConfirmModal
|
||||
open={confirmLeave}
|
||||
title={t('orbit.confirmLeaveTitle')}
|
||||
message={t('orbit.confirmLeaveBody', { name: state.name, host: state.host })}
|
||||
confirmLabel={t('orbit.confirmLeaveConfirm')}
|
||||
title={role === 'host'
|
||||
? t('orbit.confirmEndTitle')
|
||||
: 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')}
|
||||
danger={role === 'host'}
|
||||
onConfirm={() => { setConfirmLeave(false); void performExit(); }}
|
||||
onCancel={() => setConfirmLeave(false)}
|
||||
/>
|
||||
|
||||
@@ -1511,6 +1511,9 @@ export const deTranslation = {
|
||||
confirmLeaveTitle: 'Session verlassen?',
|
||||
confirmLeaveBody: '„{{name}}" wirklich verlassen? Du kannst jederzeit über {{host}}s Einladungslink wieder beitreten.',
|
||||
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',
|
||||
invalidLinkBody: 'Diese Orbit-Session existiert nicht mehr oder wurde bereits beendet. Bitte den Gastgeber um einen neuen Einladungslink.',
|
||||
settingsTitle: 'Session-Einstellungen',
|
||||
|
||||
@@ -1514,6 +1514,9 @@ export const enTranslation = {
|
||||
confirmLeaveTitle: 'Leave session?',
|
||||
confirmLeaveBody: 'Leave "{{name}}"? You can re-join via {{host}}\'s invite link any time.',
|
||||
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',
|
||||
invalidLinkBody: 'This Orbit session doesn\'t exist any more or has already ended. Ask the host for a fresh invite link.',
|
||||
settingsTitle: 'Session settings',
|
||||
|
||||
Reference in New Issue
Block a user