Browse Source

fix: temp chat

Timothy Jaeryang Baek 1 month ago
parent
commit
193a927aba
1 changed files with 7 additions and 7 deletions
  1. 7 7
      src/routes/(app)/+layout.svelte

+ 7 - 7
src/routes/(app)/+layout.svelte

@@ -195,14 +195,14 @@
 				showChangelog.set($settings?.version !== $config.version);
 			}
 
-			if ($page.url.searchParams.get('temporary-chat') === 'true') {
-				temporaryChatEnabled.set(true);
-			}
-
-			console.log($user?.permissions);
+			if ($user?.permissions?.chat?.temporary ?? true) {
+				if ($page.url.searchParams.get('temporary-chat') === 'true') {
+					temporaryChatEnabled.set(true);
+				}
 
-			if ($user?.permissions?.chat?.temporary_enforced) {
-				temporaryChatEnabled.set(true);
+				if ($user?.permissions?.chat?.temporary_enforced) {
+					temporaryChatEnabled.set(true);
+				}
 			}
 
 			// Check for version updates