chore(format): run prettier over src/ and scripts/
Formatting was configured but never enforced: `bun run format:check` reported 199 unformatted files and ran in no workflow and in no git hook, so .prettierrc (printWidth 100, trailing commas) described an intention rather than the tree. This is the one-time sweep that makes the check gateable. Whitespace and token-reflow only -- no behavioural change: `bun run check` reports 0 errors and all 1053 frontend tests pass before and after. Kept out of every other commit on purpose. A 199-file diff mixed with real changes is unreviewable, and the next commit turns format:check into a hard CI gate so this cannot silently accumulate again.
This commit is contained in:
@@ -107,7 +107,12 @@ function createPlaybackModeStore() {
|
||||
|
||||
// Rust handles everything - just wait for it to complete
|
||||
// It includes its own 5-second timeout for track loading
|
||||
log.debug("About to invoke playback_mode_transfer_to_remote with sessionId:", sessionId, "position:", positionOverride);
|
||||
log.debug(
|
||||
"About to invoke playback_mode_transfer_to_remote with sessionId:",
|
||||
sessionId,
|
||||
"position:",
|
||||
positionOverride,
|
||||
);
|
||||
await commands.playbackModeTransferToRemote(sessionId ?? "", positionOverride);
|
||||
log.debug("Invoke completed successfully");
|
||||
|
||||
@@ -298,9 +303,7 @@ function createPlaybackModeStore() {
|
||||
const currentState = get({ subscribe });
|
||||
if (currentState.mode === "remote") {
|
||||
log.debug("Lockscreen requested disconnect; transferring to local");
|
||||
transferToLocal().catch((e) =>
|
||||
log.error("Lockscreen-triggered transfer failed:", e),
|
||||
);
|
||||
transferToLocal().catch((e) => log.error("Lockscreen-triggered transfer failed:", e));
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -317,8 +320,7 @@ function createPlaybackModeStore() {
|
||||
return;
|
||||
}
|
||||
const mode = event.payload.mode as PlaybackMode;
|
||||
const remoteSessionId =
|
||||
mode === "remote" ? event.payload.session_id ?? null : null;
|
||||
const remoteSessionId = mode === "remote" ? (event.payload.session_id ?? null) : null;
|
||||
|
||||
// Ignore no-op re-broadcasts. The backend re-emits on every set_mode, and
|
||||
// local playback drives set_mode("local") from BOTH the frontend
|
||||
@@ -327,10 +329,7 @@ function createPlaybackModeStore() {
|
||||
// one, deselecting the remote session mid-cast and tripping the
|
||||
// disconnect-to-idle watchdog (breaking the lockscreen card, remote
|
||||
// volume, and — via the resulting mode flap — local audio).
|
||||
if (
|
||||
currentState.mode === mode &&
|
||||
currentState.remoteSessionId === remoteSessionId
|
||||
) {
|
||||
if (currentState.mode === mode && currentState.remoteSessionId === remoteSessionId) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -352,8 +351,16 @@ function createPlaybackModeStore() {
|
||||
|
||||
// If we're in remote mode but session is gone or lost control capability
|
||||
// Don't interfere during an active transfer (we intentionally clear the session)
|
||||
if (currentState.mode === "remote" && currentState.remoteSessionId && !currentState.isTransferring) {
|
||||
if (!session || session.id !== currentState.remoteSessionId || !session.supportsMediaControl) {
|
||||
if (
|
||||
currentState.mode === "remote" &&
|
||||
currentState.remoteSessionId &&
|
||||
!currentState.isTransferring
|
||||
) {
|
||||
if (
|
||||
!session ||
|
||||
session.id !== currentState.remoteSessionId ||
|
||||
!session.supportsMediaControl
|
||||
) {
|
||||
consecutiveMisses++;
|
||||
log.warn(`Remote session miss ${consecutiveMisses}/${DISCONNECT_THRESHOLD}`);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user