Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
Deykun committed Jul 28, 2024
1 parent 1c2dbb5 commit 44f1792
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 11 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#### Version 3.29
- **New**: Finnish game language added
- **New**: Incorrect color affix improved
- **Fix**: Fixed an error on desktop when navigator.vibrate is called

#### Version 3.28.1 (27.07.2024)
- **Fix**: Accessibility contrast increased for red dotted letters
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ https://crowdin.com/project/diffle-lang
[![Crowdin](https://badges.crowdin.net/diffle-lang/localized.svg)](https://crowdin.com/project/diffle-lang)

# App screenshots
![diffle lang app screenshots](./app-screenshots.png)
![diffle lang app screenshots](./app-screenshots.jpg)

### Polskie DIFFLE 🇵🇱
DIFFLE gra jak Wordle (po polsku, bez limitu znaków), każde użyte słowo podpowiada pozycję i kolejność liter w haśle.
Expand Down
Binary file added app-screenshots.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed app-screenshots.png
Binary file not shown.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"slowoku"
],
"private": true,
"version": "3.28.1",
"version": "3.29",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down
41 changes: 32 additions & 9 deletions src/hooks/useVibrate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,47 @@ function useVibrate() {
const shouldKeyboardVibrate = useSelector(state => state.app.shouldKeyboardVibrate);

const vibrate = useCallback(({ isInverted = false, duration = 40 } = {}) => {
if (shouldVibrate && !isInverted) {
navigator?.vibrate(duration);
}
try {
if (!navigator.vibrate) {
return;
}

if (shouldVibrate && !isInverted) {
navigator.vibrate(duration);
}

if (!shouldVibrate && isInverted) {
navigator?.vibrate(duration);
if (!shouldVibrate && isInverted) {
navigator.vibrate(duration);
}
} catch {
// Unsupported
}
}, [shouldVibrate]);

const vibrateKeyboard = useCallback(({ duration = 25 } = {}) => {
if (shouldKeyboardVibrate) {
navigator?.vibrate(duration);
try {
if (!navigator.vibrate) {
return;
}

if (shouldKeyboardVibrate) {
navigator.vibrate(duration);
}
} catch {
// Unsupported
}
}, [shouldKeyboardVibrate]);

const vibrateKeyboardIncorrect = useCallback(({ duration = 50 } = {}) => {
if (shouldKeyboardVibrate) {
navigator?.vibrate(duration);
try {
if (!navigator.vibrate) {
return;
}
if (shouldKeyboardVibrate) {
navigator.vibrate(duration);
}
} catch {
// Unsupported
}
}, [shouldKeyboardVibrate]);

Expand Down

0 comments on commit 44f1792

Please sign in to comment.