mirror of
https://github.com/Jellify-Music/App.git
synced 2026-04-28 14:39:33 -05:00
16 lines
497 B
TypeScript
16 lines
497 B
TypeScript
import AsyncStorage from "@react-native-async-storage/async-storage"
|
|
import { AsyncStorageKeys } from "../../../enums/async-storage-keys"
|
|
import _ from "lodash";
|
|
|
|
|
|
export const fetchServerUrl : Promise<string> = new Promise(async (resolve, reject) => {
|
|
|
|
console.log("Attempting to fetch server address from storage");
|
|
|
|
let url = await AsyncStorage.getItem(AsyncStorageKeys.ServerUrl)!;
|
|
|
|
if (_.isEmpty(url))
|
|
reject("No stored server address exists");
|
|
|
|
resolve(url!);
|
|
}); |