@@ -3,9 +3,9 @@ import { AppService } from "./app.service";
33import { PwaBadgeComponent } from "./pwa-badge.component" ;
44
55@Component ( {
6- selector : "app-root" ,
7- imports : [ PwaBadgeComponent ] ,
8- template : `
6+ selector : "app-root" ,
7+ imports : [ PwaBadgeComponent ] ,
8+ template : `
99 <div class="min-h-screen px-8 py-8">
1010 <div class="mx-auto max-w-md">
1111 <div class="mb-2 flex items-center justify-between pb-4">
@@ -149,62 +149,62 @@ import { PwaBadgeComponent } from "./pwa-badge.component";
149149 ` ,
150150} )
151151export class App {
152- protected readonly appService = inject ( AppService ) ;
152+ protected readonly appService = inject ( AppService ) ;
153153
154- protected readonly showMnemonic = signal ( false ) ;
155- protected readonly newTodoTitle = signal ( "" ) ;
154+ protected readonly showMnemonic = signal ( false ) ;
155+ protected readonly newTodoTitle = signal ( "" ) ;
156156
157- /** Todos */
157+ /** Todos */
158158
159- protected setNewTodoTitle ( value : string ) {
160- this . newTodoTitle . set ( value ) ;
161- }
159+ protected setNewTodoTitle ( value : string ) {
160+ this . newTodoTitle . set ( value ) ;
161+ }
162162
163- protected handleKeyDown ( event : KeyboardEvent ) {
164- if ( event . key === "Enter" ) {
165- this . handleAddTodo ( ) ;
166- }
167- }
163+ protected handleKeyDown ( event : KeyboardEvent ) {
164+ if ( event . key === "Enter" ) {
165+ this . handleAddTodo ( ) ;
166+ }
167+ }
168168
169- protected handleAddTodo ( ) {
170- const title = this . newTodoTitle ( ) . trim ( ) ;
171- if ( ! title ) return ;
169+ protected handleAddTodo ( ) {
170+ const title = this . newTodoTitle ( ) . trim ( ) ;
171+ if ( ! title ) return ;
172172
173- this . appService . addTodo ( title ) ;
174- this . newTodoTitle . set ( "" ) ;
175- }
173+ this . appService . addTodo ( title ) ;
174+ this . newTodoTitle . set ( "" ) ;
175+ }
176176
177- protected handleRenameTodo ( id : string , currentTitle : string ) {
178- const title = window . prompt ( "Todo Name" , currentTitle ) ;
179- if ( title == null ) return ;
177+ protected handleRenameTodo ( id : string , currentTitle : string ) {
178+ const title = window . prompt ( "Todo Name" , currentTitle ) ;
179+ if ( title == null ) return ;
180180
181- this . appService . renameTodo ( id , title ) ;
182- }
181+ this . appService . renameTodo ( id , title ) ;
182+ }
183183
184- protected handleDeleteTodo ( id : string ) {
185- this . appService . deleteTodo ( id ) ;
186- }
184+ protected handleDeleteTodo ( id : string ) {
185+ this . appService . deleteTodo ( id ) ;
186+ }
187187
188- /** Footer button handlers */
188+ /** Footer button handlers */
189189
190- protected handleShowMnemonic ( ) {
191- this . showMnemonic . update ( ( show ) => ! show ) ;
192- }
190+ protected handleShowMnemonic ( ) {
191+ this . showMnemonic . update ( ( show ) => ! show ) ;
192+ }
193193
194- protected handleRestoreOwner ( ) {
195- const mnemonic = window . prompt ( "Your Mnemonic" ) ;
196- if ( mnemonic == null ) return ;
194+ protected handleRestoreOwner ( ) {
195+ const mnemonic = window . prompt ( "Your Mnemonic" ) ;
196+ if ( mnemonic == null ) return ;
197197
198- void this . appService . restoreFromMnemonic ( mnemonic ) ;
199- }
198+ void this . appService . restoreFromMnemonic ( mnemonic ) ;
199+ }
200200
201- protected handleResetOwner ( ) {
202- if ( confirm ( "Are you sure? It will delete all your local data." ) ) {
203- void this . appService . resetAppOwner ( ) ;
204- }
205- }
201+ protected handleResetOwner ( ) {
202+ if ( confirm ( "Are you sure? It will delete all your local data." ) ) {
203+ void this . appService . resetAppOwner ( ) ;
204+ }
205+ }
206206
207- protected handleDownloadDatabase ( ) {
208- void this . appService . downloadDatabase ( ) ;
209- }
207+ protected handleDownloadDatabase ( ) {
208+ void this . appService . downloadDatabase ( ) ;
209+ }
210210}
0 commit comments