* 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
17 lines
461 B
TypeScript
17 lines
461 B
TypeScript
import type { Comment } from 'common/types';
|
|
import { StaticStore } from 'common/static-store';
|
|
|
|
import { StoreState } from '../index';
|
|
|
|
export const getThreadIsCollapsed = (comment: Comment) => (state: StoreState): boolean => {
|
|
const collapsed = state.collapsedThreads[comment.id];
|
|
|
|
if (collapsed !== null && collapsed !== undefined) {
|
|
return collapsed;
|
|
}
|
|
|
|
const score = comment.score || 0;
|
|
|
|
return score <= StaticStore.config.critical_score;
|
|
};
|