Skip to content

Commit

Permalink
Merge pull request #856 from schorschii/notes-bytearray-fix
Browse files Browse the repository at this point in the history
avoid Array.toString() error messages
  • Loading branch information
brownsr committed Jun 29, 2023
2 parents 1d26eb5 + 5bf025d commit bdcb927
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions notes@schorschii/files/notes@schorschii/desklet.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const Cogl = imports.gi.Cogl;
const Gio = imports.gi.Gio;
const PopupMenu = imports.ui.popupMenu;
const Gettext = imports.gettext;
const ByteArray = imports.byteArray;

const UUID = "notes@schorschii";
const DESKLET_ROOT = imports.ui.deskletManager.deskletMeta[UUID].path;
Expand Down Expand Up @@ -96,7 +97,7 @@ MyDesklet.prototype = {
try {
let [success, contents, tag] = file.load_contents_finish(response);
if(success) {
let lines = contents.toString().split('\n');
let lines = ByteArray.toString(contents).split('\n');
for(var i = 0;i < lines.length;i++) {
let fields = lines[i].split(',');
if(fields.length != 9) { continue; }
Expand Down Expand Up @@ -137,7 +138,7 @@ MyDesklet.prototype = {
try {
let [success, contents, tag] = file.load_contents_finish(response);
if(success) {
this.notecontent = contents.toString();
this.notecontent = ByteArray.toString(contents);
} else {
// error reading file - maybe the file does not exist
this.notecontent = _("Can't read text file.\nSelect a file in settings.\n\nClick here to edit.");
Expand Down

0 comments on commit bdcb927

Please sign in to comment.