Skip to content
This repository has been archived by the owner on Apr 6, 2024. It is now read-only.

細かい変更 #161

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
8 changes: 6 additions & 2 deletions client/src/components/ShootButton/ShootButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,12 @@ export const ShootButton = ({ userId }: Props) => {
const shootAudio = new Audio(staticPath.sounds.shoot_mp3);

const vibration = (time: number) => {
if (typeof window.navigator.vibrate === 'function') {
navigator.vibrate(time);
try {
if (typeof window.navigator.vibrate === 'function') {
navigator.vibrate(time);
}
} catch (e) {
console.log(e);
rarandeyo marked this conversation as resolved.
Show resolved Hide resolved
}
};

Expand Down
4 changes: 3 additions & 1 deletion client/src/pages/controller/index.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ const Home = () => {
const getUserId = useCallback(async () => {
const localStorageUserId = getUserIdFromLocalStorage();
if (localStorageUserId === null) {
router.push('/login');
router.replace('/login').then(() => {
window.location.reload();
});
return;
}
setUserId(localStorageUserId);
Expand Down
Loading