Fix notification centre icons and dismissal
This commit is contained in:
1 parent
77ba1dadff
commit
ad46fe4a53
5 files changed
+50
-17
No files matched your search
@@ -1,18 +1,23 @@
|
||||
.pragma library
|
||||
|
||||
// Each history file is one line of JSON, so the reader concatenates the
|
||||
// directory and parses line by line. Newest first, by timestamp.
|
||||
// Each history file is one line of JSON, and the reader prefixes every line
|
||||
// with the file's name and a tab so an entry can be removed later. Newest
|
||||
// first, by timestamp.
|
||||
function parseHistory(raw) {
|
||||
var lines = String(raw || "").split("\n")
|
||||
var entries = []
|
||||
for (var i = 0; i < lines.length; i++) {
|
||||
var line = lines[i].trim()
|
||||
if (!line) continue
|
||||
var tab = line.indexOf("\t")
|
||||
var fileName = tab >= 0 ? line.slice(0, tab) : ""
|
||||
var json = tab >= 0 ? line.slice(tab + 1) : line
|
||||
try {
|
||||
var value = JSON.parse(line)
|
||||
var value = JSON.parse(json)
|
||||
if (!value || typeof value !== "object") continue
|
||||
entries.push({
|
||||
id: value.id || 0,
|
||||
fileName: fileName,
|
||||
app: value.app || "",
|
||||
summary: value.summary || "",
|
||||
body: value.body || "",
|
||||
|
||||
Reference in new issue
Block a user