File tree 2 files changed +7
-11
lines changed
2 files changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -10,17 +10,9 @@ import Icon from "./Icon.svelte";
10
10
function close() {
11
11
dispatch (' close' );
12
12
}
13
-
14
- const getColor = (type : string ) => {
15
- switch (type ) {
16
- case " error" :
17
- return " red" ;
18
- }
19
- return " blue" ;
20
- }
21
13
</script >
22
14
23
- <div class ="toast" style = "--color: { getColor ( notification .type )} " >
15
+ <div class ="toast" class:error ={ notification .type == 1 } >
24
16
<div class ="text" >{notification .text }</div >
25
17
<div class ="icon" on:click ={close }>
26
18
<Icon icon =" X16" />
@@ -30,7 +22,10 @@ import Icon from "./Icon.svelte";
30
22
<style >
31
23
.toast {
32
24
@apply flex justify-between items-center shadow-lg border bg-gray- 900 text-light- 200 fill-light- 200 border-gray- 600 p- 3 rounded-sm select-none ;
33
- /* border-bottom: 1px solid var(--color);*/
25
+ }
26
+
27
+ .toast.error {
28
+ @apply bg-red- 900 border-red- 700;
34
29
}
35
30
36
31
.icon {
Original file line number Diff line number Diff line change 1
1
import { get } from "svelte/store" ;
2
2
import { authenticating , selectedSession } from "./store/runtime" ;
3
+ import { notify } from "./utils/notification" ;
3
4
4
5
export const connectSignals = ( ) => {
5
6
console . debug ( `connecting to lightdm signals using theme` , window . theme ) ;
@@ -24,7 +25,7 @@ export const connectSignals = () => {
24
25
console . debug ( "authentication_complete" ) ;
25
26
authenticating . update ( _ => false ) ;
26
27
if ( ! window . lightdm ?. is_authenticated ) {
27
- window . lightdm . show_message . _emit ( "Authentication Failed" , "error" ) ;
28
+ notify ( "Authentication Failed" , 1 ) ;
28
29
window . lightdm . authenticate ( window . lightdm . authentication_user ) ;
29
30
} else {
30
31
console . debug ( "authentication successful, start session" ) ;
You can’t perform that action at this time.
0 commit comments