feat: support suppressing version checks
This commit is contained in:
@@ -90,7 +90,7 @@
|
||||
};
|
||||
|
||||
onMount(async () => {
|
||||
if (!$config?.offline_mode) {
|
||||
if ($config?.features?.enable_version_update_check) {
|
||||
checkForVersionUpdates();
|
||||
}
|
||||
|
||||
@@ -162,7 +162,7 @@
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{#if !$config?.offline_mode}
|
||||
{#if $config?.features?.enable_version_update_check}
|
||||
<button
|
||||
class=" text-xs px-3 py-1.5 bg-gray-50 hover:bg-gray-100 dark:bg-gray-850 dark:hover:bg-gray-800 transition rounded-lg font-medium"
|
||||
type="button"
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
return '';
|
||||
});
|
||||
|
||||
if (!$config?.offline_mode) {
|
||||
if ($config?.features?.enable_version_update_check) {
|
||||
checkForVersionUpdates();
|
||||
}
|
||||
});
|
||||
@@ -82,7 +82,7 @@
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{#if $config?.offline_mode}
|
||||
{#if $config?.features?.enable_version_update_check}
|
||||
<button
|
||||
class=" text-xs px-3 py-1.5 bg-gray-100 hover:bg-gray-200 dark:bg-gray-850 dark:hover:bg-gray-800 transition rounded-lg font-medium"
|
||||
on:click={() => {
|
||||
|
||||
@@ -255,6 +255,7 @@ type Config = {
|
||||
enable_community_sharing: boolean;
|
||||
enable_autocomplete_generation: boolean;
|
||||
enable_direct_connections: boolean;
|
||||
enable_version_update_check: boolean;
|
||||
};
|
||||
oauth: {
|
||||
providers: {
|
||||
|
||||
@@ -227,7 +227,7 @@
|
||||
}
|
||||
|
||||
// Check for version updates
|
||||
if ($user?.role === 'admin' && !$config?.offline_mode) {
|
||||
if ($user?.role === 'admin' && $config?.features?.enable_version_update_check) {
|
||||
// Check if the user has dismissed the update toast in the last 24 hours
|
||||
if (localStorage.dismissedUpdateToast) {
|
||||
const dismissedUpdateToast = new Date(Number(localStorage.dismissedUpdateToast));
|
||||
|
||||
Reference in New Issue
Block a user