Total Complexity | 5 |
Complexity/F | 1.25 |
Lines of Code | 36 |
Function Count | 4 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | const config = require('./configs/main'); |
||
2 | require('../s/main.css'); |
||
3 | |||
4 | // Disable Google Analytics tracking function for DEV environment. |
||
5 | // With the purpose don't break other places - here just define mock. |
||
6 | /** global: gtag */ |
||
7 | if (typeof gtag === 'undefined') { |
||
8 | window.gtag = () => {}; |
||
9 | } |
||
10 | |||
11 | module.exports = { |
||
12 | config, |
||
13 | |||
14 | /** |
||
15 | * Gets current Stream Id from current URL. |
||
16 | * |
||
17 | * @returns {string} Current Stream Id. |
||
18 | */ |
||
19 | getStreamId: () => window.location.pathname.substring(1), |
||
20 | |||
21 | /** |
||
22 | * Gets auto-scrolling value, by default true. |
||
23 | * |
||
24 | * @returns {boolean} |
||
25 | */ |
||
26 | getAutoScroll: () => config.autoScroll, |
||
27 | |||
28 | /** |
||
29 | * Sets auto-scrolling value. |
||
30 | * |
||
31 | * @param {boolean} value Auto-scrolling value. |
||
32 | */ |
||
33 | setAutoScroll: (value) => { |
||
34 | config.autoScroll = value; |
||
35 | }, |
||
36 | }; |
||
37 |