mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-06-04 13:08:33 +01:00
refactor(settings): restore expo-ui bottom sheet and direct clipboard (drop stale-build workarounds)
This commit is contained in:
@@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user