Skip to content

Commit

Permalink
fix some ios-only things creeping into android
Browse files Browse the repository at this point in the history
  • Loading branch information
mozzius committed Feb 15, 2024
1 parent 26a6baa commit 3f47f41
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 28 deletions.
26 changes: 15 additions & 11 deletions apps/expo/src/app/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -350,17 +350,21 @@ const App = () => {
name="edit-bio"
options={{
title: "Edit Profile",
presentation: "modal",
headerTransparent: true,
headerShadowVisible: true,
headerBlurEffect: theme.dark
? "systemThickMaterialDark"
: "systemChromeMaterialLight",
headerStyle: {
backgroundColor: theme.dark
? "rgba(0,0,0,0.4)"
: "rgba(255,255,255,0.1)",
},
...Platform.select({
ios: {
presentation: "modal",
headerTransparent: true,
headerShadowVisible: true,
headerBlurEffect: theme.dark
? "systemThickMaterialDark"
: "systemChromeMaterialLight",
headerStyle: {
backgroundColor: theme.dark
? "rgba(0,0,0,0.4)"
: "rgba(255,255,255,0.1)",
},
},
}),
}}
/>
<Stack.Screen
Expand Down
24 changes: 13 additions & 11 deletions apps/expo/src/app/capture/[author]/[post].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,17 +144,19 @@ export default function ShareAsImageScreen() {
</View>
</ScrollView>
</TransparentHeaderUntilScrolled>
<Stack.Screen
options={{
headerRight: () => (
<TouchableOpacity onPress={() => router.push("../")}>
<Text primary className="text-lg">
Cancel
</Text>
</TouchableOpacity>
),
}}
/>
{Platform.OS === "ios" && (
<Stack.Screen
options={{
headerRight: () => (
<TouchableOpacity onPress={() => router.push("../")}>
<Text primary className="text-lg">
Cancel
</Text>
</TouchableOpacity>
),
}}
/>
)}
</>
);
}
Expand Down
14 changes: 8 additions & 6 deletions apps/expo/src/lib/hooks/notifications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,14 @@ export const useNotifications = () => {
const token = await getPushToken();
if (token) {
try {
await agent.app.bsky.notification.registerPush({
serviceDid: SERVICE_DID,
platform: Platform.OS,
token: token.data,
appId: "dev.mozzius.graysky",
});
if (agent.hasSession) {
await agent.app.bsky.notification.registerPush({
serviceDid: SERVICE_DID,
platform: Platform.OS,
token: token.data,
appId: "dev.mozzius.graysky",
});
}
} catch (error) {
Sentry.captureException(
new Error("Failed to register push token", { cause: error }),
Expand Down

0 comments on commit 3f47f41

Please sign in to comment.