File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ window.onload = async (event) => {
3535 tt . innerHTML = await window . utils . formatKeyboardShortcut ( keyboardShortcut )
3636 } )
3737
38- window . setInterval ( async ( ) => {
38+ setInterval ( async ( ) => {
3939 if ( await window . settings . get ( 'currentTimeInBreaks' ) ) {
4040 document . querySelector ( '.breaks > :last-child' ) . innerHTML =
4141 ( new Date ( ) ) . toLocaleTimeString ( )
Original file line number Diff line number Diff line change @@ -119,20 +119,10 @@ window.onload = async (e) => {
119119 window . stretchly . openSyncPreferences ( )
120120 }
121121
122- // TODO refactor out?
123- const copyToClipBoard = async ( str ) => {
124- const el = document . createElement ( 'textarea' )
125- el . value = str
126- document . body . appendChild ( el )
127- el . select ( )
128- await navigator . clipboard . writeText ( el . value )
129- document . body . removeChild ( el )
130- }
131-
132- document . querySelector ( '.debug button' ) . onclick = ( event ) => {
122+ document . querySelector ( '.debug button' ) . onclick = async ( event ) => {
133123 event . preventDefault ( )
134124 const toCopy = document . querySelector ( '#to-copy' )
135- copyToClipBoard ( toCopy . textContent )
125+ await navigator . clipboard . writeText ( toCopy . textContent )
136126 const copiedEl = document . createElement ( 'span' )
137127 copiedEl . innerHTML = ' copied!'
138128 event . target . parentNode . appendChild ( copiedEl )
You can’t perform that action at this time.
0 commit comments