Skip to content

Commit

Permalink
Fix issues
Browse files Browse the repository at this point in the history
  • Loading branch information
tkoibaev committed Dec 15, 2024
1 parent 1df67ea commit 8cc67bd
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 16 deletions.
13 changes: 11 additions & 2 deletions public/consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { User } from 'types/user';

export const PREV_HOST = 'http://185.241.195.151/';
export const HOST = 'https://cassette-world.ru/';
// export const API_URL = HOST + 'api/';
export const API_URL = 'http://localhost:8080/api/';
export const API_URL = HOST + 'api/';
// export const API_URL = 'http://localhost:8080/api/';
// export const API_URL = 'http://192.168.2.1:8080/api/';

export const GRID_MOVIES_AMOUNT = 3;
Expand Down Expand Up @@ -184,3 +184,12 @@ export const CARD_PREVIEW_HIDING_TIMEOUT = 300;
export const PLAYER_CONTROLL_HIDING_TIMEOUT = 3000;
export const NOTIFIER_WRAPPER_CLEAN_TIMEOUT = 300;
export const CLOSING_SERIES_MENU_TIMEOUT = 300;

export const DEVICES_LIST = [
'iPad Simulator',
'iPhone Simulator',
'iPod Simulator',
'iPad',
'iPhone',
'iPod',
];
11 changes: 3 additions & 8 deletions public/modules/IsMobileDevice.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { DEVICES_LIST } from 'consts';

export const isMobileDevice = () => {
return window.matchMedia('only screen and (max-width: 750px)').matches;
};
Expand All @@ -8,14 +10,7 @@ export const isTabletOrMobileLandscape = () => {

export const isiOS = () => {
return (
[
'iPad Simulator',
'iPhone Simulator',
'iPod Simulator',
'iPad',
'iPhone',
'iPod',
].includes(navigator.platform) ||
DEVICES_LIST.includes(navigator.platform) ||
(navigator.userAgent.includes('Mac') && 'ontouchend' in document)
);
};
Expand Down
11 changes: 5 additions & 6 deletions public/store/FavoritesPageStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,12 @@ class FavoritesPageStore {
favoritePage.render();
if (userStore.getisUserLoading()) {
return;
}
if (userStore.getUser().username) {
await this.getFavorites();
favoritePage.render();
} else {
if (userStore.getUser().username) {
await this.getFavorites();
favoritePage.render();
} else {
router.go('/');
}
router.go('/');
}
} //TK

Expand Down

0 comments on commit 8cc67bd

Please sign in to comment.