Skip to content

Commit

Permalink
Merge branch 'main' into notif-settings
Browse files Browse the repository at this point in the history
  • Loading branch information
jcesarmobile authored Dec 12, 2023
2 parents 69838da + 202a97d commit b9054a7
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 11 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/setup-node@v1
- uses: actions/setup-node@v3
with:
node-version: 14
- uses: actions/checkout@v2
node-version: 16
- uses: actions/checkout@v3
- name: Restore Dependency Cache
uses: actions/cache@v1
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.OS }}-dependency-cache-${{ hashFiles('**/package.json') }}
Expand Down
8 changes: 6 additions & 2 deletions src/pages/LocalNotifications.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,14 @@ const LocalNotificationsPage: React.FC = () => {
};
}, []);

useIonViewDidEnter(async () => {
useIonViewDidEnter(() => {
checkPermissions();
});

const checkPermissions = async () => {
const permissions = await ensurePermissions();
setHasPermission(permissions);
});
}

return (
<IonPage>
Expand Down
8 changes: 6 additions & 2 deletions src/pages/PushNotifications.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,15 @@ const PushNotificationsPage: React.FC = () => {
}
};

useIonViewDidEnter(async () => {
useIonViewDidEnter(() => {
checkPermissionsAndRegister();
});

const checkPermissionsAndRegister = async () => {
const hasPermission = await ensurePermissions();
setHasPermission(hasPermission);
await register();
});
}

return (
<IonPage>
Expand Down
10 changes: 7 additions & 3 deletions src/pages/TextZoom.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,19 @@ const TextZoomPage: React.FC = () => {
const [level, setLevel] = useState('1');
const [showButtons, setShowButtons] = useState(true);

useIonViewDidEnter(async () => {
useIonViewDidEnter(() => {
if (Capacitor.isPluginAvailable('TextZoom')) {
const { value: level } = await TextZoom.get();
setLevel(level.toString());
getInitialZoom();
} else {
setShowButtons(false);
}
});

const getInitialZoom = async () => {
const { value: level } = await TextZoom.get();
setLevel(level.toString());
}

const handleLevelInputChange = createEventTargetValueExtractor(setLevel);

const getZoomLevel = async () => {
Expand Down

0 comments on commit b9054a7

Please sign in to comment.