Skip to content

Commit 9a0f443

Browse files
authored
$mol_button_copy: simplify
1 parent cc603bf commit 9a0f443

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

button/copy/copy.view.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ namespace $.$$ {
2424

2525
click( event?: Event ) {
2626
const cb = $mol_wire_sync( this.$.$mol_dom_context.navigator.clipboard )
27-
28-
if( cb.writeText ) cb.writeText( this.text() )
29-
if( cb.write ) cb.write( this.attachments() )
27+
28+
cb.writeText?.( this.text() )
29+
cb.write?.( this.attachments() )
3030

3131
if( cb.writeText === undefined && cb.write === undefined ) {
32-
throw new Error( "Browser cannot support write functions" )
32+
throw new Error( "doesn't support copy to clipoard" )
3333
}
3434
}
3535

0 commit comments

Comments
 (0)