refactor(settings): restore expo-ui bottom sheet and direct clipboard (drop stale-build workarounds)

This commit is contained in:
Gauvain
2026-06-04 00:36:44 +02:00
parent 059c8bb854
commit da47ad0502
4 changed files with 36 additions and 35 deletions

View File

@@ -1,4 +1,5 @@
import * as Application from "expo-application";
import { setStringAsync } from "expo-clipboard";
import { t } from "i18next";
import { useAtom } from "jotai";
import { useState } from "react";
@@ -19,17 +20,9 @@ export default function AccountPage() {
const copyToken = async () => {
if (!token) return;
try {
// Lazy import: expo-clipboard is a native module. Importing it at module
// top crashes the screen on a dev client built before it was added; the
// dynamic import defers loading until the user taps copy.
const Clipboard = await import("expo-clipboard");
await Clipboard.setStringAsync(token);
success();
Alert.alert(t("home.settings.account.copied"));
} catch {
Alert.alert(t("home.settings.account.copy_unavailable"));
}
await setStringAsync(token);
success();
Alert.alert(t("home.settings.account.copied"));
};
return (