Skip to content

Commit ae53d19

Browse files
authored
Merge pull request #29 from PiterWeb/main
Bug corrections
2 parents 319c9c4 + 8956f1a commit ae53d19

File tree

15 files changed

+70
-53
lines changed

15 files changed

+70
-53
lines changed

frontend/package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"tailwindcss": "^3.3.3",
3232
"tslib": "^2.4.1",
3333
"typescript": "^5.0.0",
34-
"vite": "^4.5.2"
34+
"vite": "^4.5.3"
3535
},
3636
"type": "module",
3737
"dependencies": {

frontend/pnpm-lock.yaml

Lines changed: 25 additions & 25 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/src/lib/i18n/LanguageSelector.svelte

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
function setLocale(event: Event) {
55
const target = event.target as HTMLButtonElement;
66
locale.set(target.dataset.value);
7-
// @ts-ignore
8-
window.navigator.language = target.dataset.value;
97
}
108
119
function getLocaleName(locale: string) {

frontend/src/lib/layout/PageTransition.svelte

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33
44
export let key: string;
55
export let duration: number = 0;
6+
7+
const audio = new Audio('/sounds/page_transition.mp3');
8+
9+
audio.volume = 0.1;
10+
11+
$: key && navigator.userActivation.isActive && audio.play();
12+
613
</script>
714

815
{#key key}

frontend/src/lib/loading/Loading.svelte

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,20 @@
55
let title: string = '';
66
let message: string = '';
77
8+
let audio: HTMLAudioElement;
9+
810
$: if ($loadingWritable.loading && loadingModal) {
911
loadingModal.showModal();
10-
title = $loadingWritable.title;
11-
message = $loadingWritable.message;
12+
title = $loadingWritable.title ?? title;
13+
message = $loadingWritable.message ?? message;
14+
audio.play();
1215
} else if (loadingModal) {
1316
loadingModal.close();
1417
}
1518
</script>
1619

20+
<audio bind:this={audio} volume={0.1} src="/sounds/open_modal.mp3" preload="auto"></audio>
21+
1722
<dialog class="modal modal-bottom sm:modal-middle" bind:this={loadingModal}>
1823
<div class="modal-box flex flex-col items-center gap-6">
1924
<h4 class="font-bold text-lg">{title}</h4>

frontend/src/lib/loading/loading_hook.ts

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,21 @@ export function toogleLoading() {
1717
const currentLoading = get(loadingWritable);
1818

1919
if (!currentLoading.message && !currentLoading.title) {
20-
loadingWritable.update((store) => ({
21-
...store,
22-
title: get(_)('default-loading-title'),
23-
message: get(_)('default-loading-message')
24-
}));
20+
loadingWritable.update((store) => {
21+
const translatedLoading = {
22+
...store,
23+
title: get(_)('default-loading-title'),
24+
message: get(_)('default-loading-message')
25+
};
26+
27+
const loading = !store.loading;
28+
29+
if (loading) {
30+
return { ...translatedLoading, loading };
31+
}
32+
33+
return defaultLoadingStore;
34+
});
2535
return;
2636
}
2737

frontend/src/lib/toast/Toast.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
</script>
44

55
{#if $toast.show}
6+
<audio volume={0.1} src="/sounds/open_modal.mp3" preload="auto" autoplay></audio>
67
<div class="toast toast-end">
78
<div class={`shadow-lg px-6 py-3 bg-${$toast.type} font-bold`}>
89
<span>{$toast.message}</span>

frontend/src/lib/webrtc/turn_servers.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
import { get, writable } from 'svelte/store';
22
import type { ServersConfig, ICEServer } from '$lib/webrtc/ice';
33

4-
const defaultTurnServers: string[] = [];
5-
64
const defaultTurnConfig: Readonly<ServersConfig> = {
7-
default: {
8-
urls: defaultTurnServers
9-
}
5+
106
};
117

128
const turnServersStore = writable<ServersConfig>(
3.63 KB
Binary file not shown.

0 commit comments

Comments
 (0)