Skip to content

Commit 56a2dd2

Browse files
committedAug 1, 2023
Notifications improvement
1 parent 0bc8ae8 commit 56a2dd2

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed
 

‎notifications.ps1

+2-4
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ if ($args[0] -eq "setup") {
3636
}
3737
}
3838

39-
4039
# Empty the notifications file
4140
Set-Content $notif_file $null
4241

@@ -150,14 +149,13 @@ while ($true) {
150149
if ($line -like "*,*") {
151150
$title = $line.Split(",")[0]
152151
$message = $line.Split(",")[1]
152+
# If the title and the message are not empty, remove the line from the file and send the notification
153153
if ($title -ne "" -and $message -ne "") {
154154
$content = Get-Content $notif_file | Where-Object { $_ -ne $line }
155155
Set-Content $notif_file $content
156-
if ($title -eq "stop" -and $message -eq "stop") {
157-
exit 0
158-
}
159156
New-BurntToastNotification -Text $title,$message -AppLogo $icon -AppId $appId
160157
}
158+
# If the line is empty, remove it from the file
161159
} elseif ($line -eq "") {
162160
$content = Get-Content $notif_file | Where-Object { $_ -ne $line }
163161
Set-Content $notif_file $content

0 commit comments

Comments
 (0)