amalia/23-okt-25 #1

Merged
amaliadwiy merged 203 commits from amalia/23-okt-25 into join 2025-10-27 11:19:44 +08:00
113 changed files with 3384 additions and 360 deletions
Showing only changes of commit db98c3afc5 - Show all commits

View File

@@ -55,9 +55,11 @@ export default function AuthProvider({ children }: { children: ReactNode }): Rea
const hasil = await decryptToken(String(token)) const hasil = await decryptToken(String(token))
const permission = await requestPermission() const permission = await requestPermission()
if (permission) { if (permission) {
const tokenDevice = await getToken()
try { try {
const register = await apiRegisteredToken({ user: hasil, token: String(tokenDevice) }) if (Platform.OS === 'android') {
const tokenDevice = await getToken()
const register = await apiRegisteredToken({ user: hasil, token: String(tokenDevice) })
}
} catch (error) { } catch (error) {
console.error(error) console.error(error)
} finally { } finally {
@@ -77,7 +79,7 @@ export default function AuthProvider({ children }: { children: ReactNode }): Rea
try { try {
const hasil = await decryptToken(String(tokenRef.current)) const hasil = await decryptToken(String(tokenRef.current))
const token = await getToken() const token = await getToken()
if (Platform.OS === 'android'){ if (Platform.OS === 'android') {
const response = await apiUnregisteredToken({ user: hasil, token: String(token) }) const response = await apiUnregisteredToken({ user: hasil, token: String(token) })
} }
} catch (error) { } catch (error) {