mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
Merge pull request #1796 from appwrite/fix-incorrect-regions
Fix: cached/incorrect regions
This commit is contained in:
@@ -29,10 +29,9 @@
|
||||
import { openImportWizard } from '../project-[region]-[project]/settings/migrations/(import)';
|
||||
import { readOnly } from '$lib/stores/billing';
|
||||
import { onMount } from 'svelte';
|
||||
import { organization } from '$lib/stores/organization';
|
||||
import { canWriteProjects } from '$lib/stores/roles';
|
||||
import { checkPricingRefAndRedirect } from '$lib/helpers/pricingRedirect';
|
||||
import { regions as regionsStore } from '$routes/(console)/organization-[organization]/store';
|
||||
import { organization, regions as regionsStore } from '$lib/stores/organization';
|
||||
|
||||
export let data;
|
||||
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import { page } from '$app/stores';
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
import { derived, writable } from 'svelte/store';
|
||||
import type { RegionList } from '$lib/sdk/billing';
|
||||
import { derived } from 'svelte/store';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
import { regions } from '$lib/stores/organization';
|
||||
|
||||
export const regions = writable<RegionList | undefined>(undefined);
|
||||
export const regionFlagUrls = derived(regions, ($regions) => {
|
||||
if (!$regions?.regions?.length) return [];
|
||||
|
||||
|
||||
@@ -3,15 +3,15 @@
|
||||
import { Pill } from '$lib/elements';
|
||||
import { InputText, FormList } from '$lib/elements/forms';
|
||||
import { WizardStep } from '$lib/layout';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { createProject } from './store';
|
||||
import { regionFlagUrls, regions } from '../store';
|
||||
import { organization } from '$lib/stores/organization';
|
||||
import { regionFlagUrls } from '../store';
|
||||
import { organization, regions } from '$lib/stores/organization';
|
||||
import { loadAvailableRegions } from '$routes/(console)/regions';
|
||||
|
||||
let showCustomId = false;
|
||||
|
||||
if (!$regions?.regions) {
|
||||
sdk.forConsole.billing.listRegions($organization.$id).then(regions.set);
|
||||
loadAvailableRegions($organization.$id);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
import { page } from '$app/stores';
|
||||
import { regions } from '$routes/(console)/organization-[organization]/store';
|
||||
import { regions } from '$lib/stores/organization';
|
||||
|
||||
let prefs: Models.Preferences;
|
||||
|
||||
|
||||
@@ -5,13 +5,13 @@ import type { LayoutLoad } from './$types';
|
||||
import { preferences } from '$lib/stores/preferences';
|
||||
import { failedInvoice } from '$lib/stores/billing';
|
||||
import { isCloud } from '$lib/system';
|
||||
import type { Organization } from '$lib/stores/organization';
|
||||
import { defaultRoles, defaultScopes } from '$lib/constants';
|
||||
import type { Plan } from '$lib/sdk/billing';
|
||||
import { get } from 'svelte/store';
|
||||
import { headerAlert } from '$lib/stores/headerAlert';
|
||||
import PaymentFailed from '$lib/components/billing/alerts/paymentFailed.svelte';
|
||||
import { loadAvailableRegions } from '$routes/(console)/regions';
|
||||
import type { Organization } from '$lib/stores/organization';
|
||||
|
||||
export const load: LayoutLoad = async ({ params, depends }) => {
|
||||
depends(Dependencies.PROJECT);
|
||||
@@ -30,7 +30,7 @@ export const load: LayoutLoad = async ({ params, depends }) => {
|
||||
organization: project.teamId
|
||||
});
|
||||
}
|
||||
preferences.loadTeamPrefs(project.teamId);
|
||||
await preferences.loadTeamPrefs(project.teamId);
|
||||
let roles = isCloud ? [] : defaultRoles;
|
||||
let scopes = isCloud ? [] : defaultScopes;
|
||||
if (isCloud) {
|
||||
|
||||
Reference in New Issue
Block a user