Merge remote-tracking branch 'origin/main' into dbkr/prevent_keyrepeat_mute_spam

This commit is contained in:
David Baker 2023-01-13 11:57:02 +00:00
commit afdce66896
4 changed files with 26 additions and 6 deletions

View file

@ -2,9 +2,24 @@ server {
listen 8080; listen 8080;
server_name localhost; server_name localhost;
root /app;
location / { location / {
root /app; # disable cache entriely by default (apart from Etag which is accurate enough)
add_header Cache-Control 'private no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
if_modified_since off;
expires off;
# also turn off last-modified since they are just the timestamps of the file in the docker image
# and may or may not bear any resemblance to when the resource changed
add_header Last-Modified "";
try_files $uri /$uri /index.html; try_files $uri /$uri /index.html;
} }
# assets can be cached because they have hashed filenames
location /assets {
expires 1w;
add_header Cache-Control "public, no-transform";
}
} }

View file

@ -94,12 +94,17 @@ export async function initClient(
const storeOpts = {} as ICreateClientOpts; const storeOpts = {} as ICreateClientOpts;
if (indexedDB && localStorage && !import.meta.env.DEV) { if (indexedDB && localStorage) {
storeOpts.store = new IndexedDBStore({ storeOpts.store = new IndexedDBStore({
indexedDB: window.indexedDB, indexedDB: window.indexedDB,
localStorage, localStorage,
dbName: SYNC_STORE_NAME, dbName: SYNC_STORE_NAME,
workerFactory: () => new IndexedDBWorker(), // We can't use the worker in dev mode because Vite simply doesn't bundle workers
// in dev mode: it expects them to use native modules. Ours don't, and even then only
// Chrome supports it. (It bundles them fine in production mode.)
workerFactory: import.meta.env.DEV
? undefined
: () => new IndexedDBWorker(),
}); });
} else if (localStorage) { } else if (localStorage) {
storeOpts.store = new MemoryStore({ localStorage }); storeOpts.store = new MemoryStore({ localStorage });

View file

@ -63,7 +63,7 @@ import { usePrefersReducedMotion } from "../usePrefersReducedMotion";
import { ParticipantInfo } from "./useGroupCall"; import { ParticipantInfo } from "./useGroupCall";
import { TileDescriptor } from "../video-grid/TileDescriptor"; import { TileDescriptor } from "../video-grid/TileDescriptor";
import { AudioSink } from "../video-grid/AudioSink"; import { AudioSink } from "../video-grid/AudioSink";
import { useKeyboardShortcuts } from "../useKeyboardShortcuts"; import { useCallViewKeyboardShortcuts } from "../useCallViewKeyboardShortcuts";
const canScreenshare = "getDisplayMedia" in (navigator.mediaDevices ?? {}); const canScreenshare = "getDisplayMedia" in (navigator.mediaDevices ?? {});
// There is currently a bug in Safari our our code with cloning and sending MediaStreams // There is currently a bug in Safari our our code with cloning and sending MediaStreams
@ -144,7 +144,7 @@ export function InCallView({
const { hideScreensharing } = useUrlParams(); const { hideScreensharing } = useUrlParams();
useKeyboardShortcuts( useCallViewKeyboardShortcuts(
!feedbackModalState.isOpen, !feedbackModalState.isOpen,
toggleMicrophoneMuted, toggleMicrophoneMuted,
toggleLocalVideoMuted, toggleLocalVideoMuted,

View file

@ -19,7 +19,7 @@ import { useCallback, useState } from "react";
import { getSetting } from "./settings/useSetting"; import { getSetting } from "./settings/useSetting";
import { useEventTarget } from "./useEvents"; import { useEventTarget } from "./useEvents";
export function useKeyboardShortcuts( export function useCallViewKeyboardShortcuts(
enabled: boolean, enabled: boolean,
toggleMicrophoneMuted: () => void, toggleMicrophoneMuted: () => void,
toggleLocalVideoMuted: () => void, toggleLocalVideoMuted: () => void,