Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions src/components/push-notification/push-notification-status.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,10 @@ import { usePushNotifications } from '@/services/push-notification';
import { useCoreStore } from '@/stores/app/core-store';

export function PushNotificationStatus() {
const { pushToken, sendTestNotification } = usePushNotifications();
const { pushToken } = usePushNotifications();
const activeUnitId = useCoreStore((state) => state.activeUnitId);
const activeUnit = useCoreStore((state) => state.activeUnit);

const handleTestNotification = () => {
sendTestNotification();
};

return (
<Box className="my-2 rounded-md border border-gray-300 p-4">
<Text className="mb-2 font-bold">Push Notification Status</Text>
Expand All @@ -28,12 +24,6 @@ export function PushNotificationStatus() {
<Text className="text-sm text-gray-700">Push Token: {pushToken ? `${pushToken.substring(0, 20)}...` : 'Not registered'}</Text>
<Text className={`text-sm ${pushToken ? 'text-green-700' : 'text-red-700'}`}>Status: {pushToken ? 'Registered' : 'Not Registered'}</Text>
</Box>

<Box className="mt-4">
<Button className="bg-blue-600 text-white" onPress={handleTestNotification} disabled={!pushToken}>
Send Test Notification
</Button>
</Box>
</Box>
);
}
1 change: 0 additions & 1 deletion src/services/push-notification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,5 @@ export const usePushNotifications = () => {

return {
pushToken: pushNotificationService.getPushToken(),
sendTestNotification: () => pushNotificationService.sendTestNotification(),
};
};
Loading