* change root dit and change way to import modules * update deps to latest versions * use latest tools for building bundles * rewrite webpack config * use nomodule technique for loading modern bundle * inject polyfills by babel usebuiltins * update eslint rules * rename all style files to CSS * use postcss preset env for building styles * proper typescript typing * put all html files to templates folder * etc
18 lines
559 B
TypeScript
18 lines
559 B
TypeScript
import { User } from 'common/types';
|
|
import { getItem } from 'common/local-storage';
|
|
import { LS_HIDDEN_USERS_KEY } from 'common/constants';
|
|
|
|
export default function getHiddenUsers() {
|
|
try {
|
|
const hiddenUsers: Record<string, User> = JSON.parse(getItem(LS_HIDDEN_USERS_KEY) || '{}');
|
|
|
|
if (typeof hiddenUsers === 'object' && hiddenUsers !== null && !Array.isArray(hiddenUsers)) {
|
|
return hiddenUsers;
|
|
}
|
|
} catch (e) {
|
|
console.error('incorrect hidden user data in local storage', e); // eslint-disable-line no-console
|
|
}
|
|
|
|
return {};
|
|
}
|