Fix: Force pull images in deploy workflow
All checks were successful
Build and Push / build-all (push) Successful in 8m52s
All checks were successful
Build and Push / build-all (push) Successful in 8m52s
This commit is contained in:
parent
5430e434c3
commit
7f56f19e94
10 changed files with 164 additions and 30 deletions
|
|
@ -330,12 +330,6 @@
|
|||
{/if}
|
||||
<button class="username-btn" style="color: {safeUserColor}" on:click={handleUsernameClick} on:dblclick={handleUsernameDoubleClick}>
|
||||
{message.username}
|
||||
{#if message.isStreamer}
|
||||
<span class="badge streamer">STREAMER</span>
|
||||
{/if}
|
||||
{#if message.isGuest}
|
||||
<span class="badge guest">GUEST</span>
|
||||
{/if}
|
||||
</button>
|
||||
{#if message.usedRoll}
|
||||
<span class="cmd-tag roll-tag">R</span>
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
} from '$lib/chat/chatStore';
|
||||
import { chatWebSocket } from '$lib/chat/chatWebSocket';
|
||||
import { chatLayout } from '$lib/stores/chatLayout';
|
||||
import { auth } from '$lib/stores/auth';
|
||||
import {
|
||||
ttsEnabled,
|
||||
ttsSettings,
|
||||
|
|
@ -238,7 +239,19 @@
|
|||
});
|
||||
|
||||
function handleSendMessage(event) {
|
||||
const { message, selfDestructSeconds } = event.detail;
|
||||
let { message, selfDestructSeconds } = event.detail;
|
||||
|
||||
// Handle /graffiti command
|
||||
if (message.trim().toLowerCase() === '/graffiti') {
|
||||
const graffitiUrl = $auth.user?.graffitiUrl;
|
||||
if (graffitiUrl) {
|
||||
message = `[graffiti]${graffitiUrl}[/graffiti]`;
|
||||
} else {
|
||||
alert('You don\'t have a graffiti yet. Create one in Settings > Appearance.');
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
chatWebSocket.sendMessage(message, userColor, selfDestructSeconds || 0);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -266,7 +266,14 @@
|
|||
});
|
||||
|
||||
if (response.ok) {
|
||||
dispatch('videoRemoved', { itemId });
|
||||
const data = await response.json();
|
||||
// Pass the full response data so the parent can update player state
|
||||
dispatch('videoRemoved', {
|
||||
itemId,
|
||||
advancedToNext: data.advancedToNext || false,
|
||||
currentVideo: data.currentVideo || null,
|
||||
playbackState: data.playbackState || null
|
||||
});
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('Failed to remove video:', e);
|
||||
|
|
|
|||
|
|
@ -24,11 +24,25 @@
|
|||
|
||||
$: realmName = $page.params.realm;
|
||||
|
||||
// Re-check ownership when auth state changes (login/logout)
|
||||
// Re-check ownership and reconnect WebSocket when auth state changes (login/logout)
|
||||
let lastAuthUserId = undefined; // undefined = not yet initialized
|
||||
$: {
|
||||
$auth; // Track auth store changes
|
||||
if (realm) {
|
||||
checkOwnership();
|
||||
const currentUserId = $auth.user?.id || null;
|
||||
if (realm && !loading) {
|
||||
// Initialize on first run after loading completes
|
||||
if (lastAuthUserId === undefined) {
|
||||
lastAuthUserId = currentUserId;
|
||||
checkOwnership();
|
||||
} else if (currentUserId !== lastAuthUserId) {
|
||||
// Auth changed - reconnect WebSocket to get updated permissions
|
||||
lastAuthUserId = currentUserId;
|
||||
checkOwnership();
|
||||
const token = browser ? localStorage.getItem('token') : null;
|
||||
watchSync.disconnect();
|
||||
setTimeout(() => {
|
||||
watchSync.connect(realm.id, token);
|
||||
}, 100);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -108,6 +122,29 @@
|
|||
isOwner = (user?.id === realm.ownerId) || user?.isAdmin;
|
||||
}
|
||||
|
||||
// Detect permission mismatch: if user is owner but WebSocket doesn't have control
|
||||
// This can happen if the WebSocket connected before auth was ready
|
||||
let permissionCheckDone = false;
|
||||
$: {
|
||||
// Only run this check once after WebSocket is connected and we know we're the owner
|
||||
if (!permissionCheckDone && isOwner && !loading && $auth.user) {
|
||||
// Give the WebSocket a moment to receive welcome message
|
||||
setTimeout(() => {
|
||||
if (isOwner && !$canControl && realm) {
|
||||
console.log('Permission mismatch detected: owner but no control. Reconnecting...');
|
||||
const token = browser ? localStorage.getItem('token') : null;
|
||||
if (token) {
|
||||
watchSync.disconnect();
|
||||
setTimeout(() => {
|
||||
watchSync.connect(realm.id, token);
|
||||
}, 100);
|
||||
}
|
||||
}
|
||||
permissionCheckDone = true;
|
||||
}, 1500);
|
||||
}
|
||||
}
|
||||
|
||||
function handleVideoAdded(event) {
|
||||
loadPlaylist();
|
||||
// Request sync to get updated current video state (video may have auto-started)
|
||||
|
|
@ -118,10 +155,16 @@
|
|||
|
||||
function handleVideoRemoved(event) {
|
||||
loadPlaylist();
|
||||
// Request sync to get updated state (current video may have been cleared)
|
||||
setTimeout(() => {
|
||||
// If the backend advanced to next video, request sync immediately to update player
|
||||
if (event.detail?.advancedToNext || event.detail?.currentVideo) {
|
||||
// Request sync immediately to get the new video playing
|
||||
watchSync.requestSync();
|
||||
}, 500);
|
||||
} else {
|
||||
// Request sync after a short delay for other cases
|
||||
setTimeout(() => {
|
||||
watchSync.requestSync();
|
||||
}, 500);
|
||||
}
|
||||
}
|
||||
|
||||
function handlePlayerReady() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue