This repository was archived by the owner on Apr 9, 2025. It is now read-only.
File tree 3 files changed +29
-10
lines changed
3 files changed +29
-10
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,8 @@ export enum ConfigName {
13
13
pingFileStart = "pingFileStart" ,
14
14
period = "period" ,
15
15
seed = "seed" ,
16
- cancelTags = "cancelTags"
16
+ cancelTags = "cancelTags" ,
17
+ editorOnStartup = "editorOnStartup"
17
18
}
18
19
export interface ConfigDict {
19
20
[ index : string ] : any ;
@@ -25,6 +26,7 @@ export interface ConfigDict {
25
26
period : number ;
26
27
seed : number ;
27
28
cancelTags : Set < string > ;
29
+ editorOnStartup : boolean ;
28
30
}
29
31
30
32
export interface ConfigPref {
@@ -189,6 +191,13 @@ export class Config {
189
191
label : "The tags to use when not supplied by the user for any reason" ,
190
192
configurable : true ,
191
193
default : [ "afk" , "RETRO" ]
194
+ } ,
195
+ {
196
+ name : ConfigName . editorOnStartup ,
197
+ type : "checkbox" ,
198
+ label : "Open the tag editor on startup if pings have been missed since last run" ,
199
+ configurable : true ,
200
+ default : false
192
201
}
193
202
] ;
194
203
}
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import windowStateKeeper = require("electron-window-state");
5
5
import * as helper from "./helper" ;
6
6
import * as edit from "./edit" ;
7
7
import { Ping } from "../ping" ;
8
+ import { ConfigName } from "./config" ;
8
9
9
10
// Global reference to prevent garbage collection
10
11
let promptWindow : Electron . BrowserWindow | null ;
@@ -166,7 +167,7 @@ export function catchUp(till: number): boolean {
166
167
* Show an editor if the time is after the next ping in the pingfile
167
168
*/
168
169
export function editorIfMissed ( ) {
169
- if ( global . pingFile . pings . length === 0 ) {
170
+ if ( ! global . config . user . get ( ConfigName . editorOnStartup ) || global . pingFile . pings . length === 0 ) {
170
171
return ;
171
172
}
172
173
Original file line number Diff line number Diff line change @@ -22,15 +22,24 @@ export const PrefGroup = (props: PrefGroupProps) => {
22
22
if ( isFormControl ) {
23
23
inProps [ "className" ] = "form-control" ;
24
24
}
25
- let type = props . pref . type ;
26
- if ( props . pref . type === "file" ) {
27
- type = "input" ;
28
- inProps [ "className" ] =
29
- ( "className" in inProps ? inProps [ "className" ] + " " : "" ) + "file-input" ;
30
- }
31
- if ( props . pref . type === "tags" ) {
32
- type = "input" ;
25
+
26
+ let type ;
27
+ switch ( props . pref . type ) {
28
+ case "file" : {
29
+ type = "input" ;
30
+ inProps [ "className" ] =
31
+ ( "className" in inProps ? inProps [ "className" ] + " " : "" ) + "file-input" ;
32
+ break ;
33
+ }
34
+ case "tags" : {
35
+ type = "input" ;
36
+ break ;
37
+ }
38
+ default : {
39
+ type = props . pref . type ;
40
+ }
33
41
}
42
+
34
43
return (
35
44
< input
36
45
readOnly = { readOnly }
You can’t perform that action at this time.
0 commit comments