Skip to content

Commit 228bf70

Browse files
authored
Fix that notifications that don't have content specified hang
It just sets the content to empty ("") by default, as if there is no content at all it hangs.
1 parent 6c92f85 commit 228bf70

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

scripts/termux-notification

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ OPT_BUTTON2_TEXT=""
4141
OPT_BUTTON2_ACTION=""
4242
OPT_BUTTON3_TEXT=""
4343
OPT_BUTTON3_ACTION=""
44+
OPT_CONTENT=""
4445

4546
TEMP=`busybox getopt \
4647
-n $SCRIPTNAME \
@@ -101,9 +102,5 @@ if [ -n "$OPT_SOUND" ]; then set -- "$@" --ez sound "$OPT_SOUND"; fi
101102
if [ -n "$OPT_TITLE" ]; then set -- "$@" --es title "$OPT_TITLE"; fi
102103
if [ -n "$OPT_VIBRATE" ]; then set -- "$@" --ela vibrate "$OPT_VIBRATE"; fi
103104

104-
if [ -v OPT_CONTENT ]; then
105-
# Note that we want to accept an empty content (--content "").
106-
echo ${OPT_CONTENT:=""} | /data/data/com.termux/files/usr/libexec/termux-api Notification "$@"
107-
else
108-
/data/data/com.termux/files/usr/libexec/termux-api Notification "$@"
109-
fi
105+
# Note that we want to accept an empty content (--content "").
106+
echo ${OPT_CONTENT:=""} | /data/data/com.termux/files/usr/libexec/termux-api Notification "$@"

0 commit comments

Comments
 (0)