import BridgeFunction from './bridgeFunction'; import { MiniAppError, MiniAppErrorType } from '../miniAppError'; class GetUserLocation extends BridgeFunction { name = 'getUserLocation'; protected async executeFunction() { let storedLocation = localStorage.getItem('location'); if (storedLocation) { return this.cbHandler?.success({ result: JSON.parse(storedLocation), }); } else { throw new MiniAppError(MiniAppErrorType.noLocationPermission); } } } export default GetUserLocation;