Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: constants #1094

Merged
merged 1 commit into from
Aug 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 0 additions & 1 deletion frontend/app/common/constants.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ export const BASE_URL = window.remark_config.host || process.env.REMARK_URL!;
export const NODE_ID = process.env.REMARK_NODE!;
export const API_BASE = '/api/v1';
export const COMMENT_NODE_CLASSNAME_PREFIX = 'remark42__comment-';
export const COUNTER_NODE_CLASSNAME = 'remark42__counter';
1 change: 0 additions & 1 deletion frontend/app/common/constants.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Sorting, Theme } from './types';

export { BASE_URL, API_BASE, NODE_ID, COMMENT_NODE_CLASSNAME_PREFIX } from './constants.config';
export const LAST_COMMENTS_NODE_CLASSNAME = 'remark42__last-comments';
export const MAX_SHOWN_ROOT_COMMENTS = 10;

export const DEFAULT_SORT: Sorting = '-active';
Expand Down
3 changes: 2 additions & 1 deletion frontend/app/counter.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { COUNTER_NODE_CLASSNAME, BASE_URL, API_BASE } from 'common/constants.config';
import { BASE_URL, API_BASE } from 'common/constants.config';

if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', init);
Expand All @@ -7,6 +7,7 @@ if (document.readyState === 'loading') {
}

function init(): void {
const COUNTER_NODE_CLASSNAME = 'remark42__counter';
const nodes = Array.from(document.getElementsByClassName(COUNTER_NODE_CLASSNAME)) as HTMLElement[];

if (!nodes) {
Expand Down