``update Add error constant for empty PocketBase URL and validate it during app initialization
``
This commit is contained in:
1
002_source/ionic_mobile/src/ERRORS.ts
Normal file
1
002_source/ionic_mobile/src/ERRORS.ts
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export const ERR_POCKETBASE_URL_IS_EMPTY = 'POCKETBASE url is empty';
|
@@ -8,6 +8,10 @@
|
|||||||
// 0.0.7 - add back button for listening practice, matching frenzy, connective revision
|
// 0.0.7 - add back button for listening practice, matching frenzy, connective revision
|
||||||
// 0.0.8 - add back button for listening practice card, matching frenzy card, connective revision card
|
// 0.0.8 - add back button for listening practice card, matching frenzy card, connective revision card
|
||||||
// 0.0.9 - fix ticket 26,27,28,29
|
// 0.0.9 - fix ticket 26,27,28,29
|
||||||
|
import { Capacitor } from '@capacitor/core';
|
||||||
|
|
||||||
|
import { ERR_POCKETBASE_URL_IS_EMPTY } from './ERRORS';
|
||||||
|
|
||||||
// 0.0.10 - remove debug symbol and re-route ending page
|
// 0.0.10 - remove debug symbol and re-route ending page
|
||||||
const VERSIONS = 'v0.0.10';
|
const VERSIONS = 'v0.0.10';
|
||||||
const HELLOWORLD_MP3 = '/helloworld.mp3';
|
const HELLOWORLD_MP3 = '/helloworld.mp3';
|
||||||
@@ -76,11 +80,14 @@ const TEST = process.env.NODE_ENV === 'test';
|
|||||||
const MY_FAVORITE = 'My Favorite';
|
const MY_FAVORITE = 'My Favorite';
|
||||||
|
|
||||||
//
|
//
|
||||||
|
if (!import.meta.env.VITE_POCKETBASE_URL) throw new Error(ERR_POCKETBASE_URL_IS_EMPTY);
|
||||||
const POCKETBASE_URL = import.meta.env.VITE_POCKETBASE_URL;
|
const POCKETBASE_URL = import.meta.env.VITE_POCKETBASE_URL;
|
||||||
//
|
//
|
||||||
// database constants
|
// database constants
|
||||||
export const COL_USERS = 'users';
|
export const COL_USERS = 'users';
|
||||||
export const COL_USER_METAS = 'UserMetas';
|
export const COL_USER_METAS = 'UserMetas';
|
||||||
|
//
|
||||||
|
export const RUNNING_PLATFORM = Capacitor.getPlatform();
|
||||||
|
|
||||||
export {
|
export {
|
||||||
//
|
//
|
||||||
|
Reference in New Issue
Block a user