Reformat background button code

This commit is contained in:
Romain Vigier
2022-02-23 21:31:13 +01:00
parent 496fccadb2
commit b0951c224c
+6 -2
View File
@@ -89,8 +89,12 @@ var BackgroundButton = GObject.registerClass({
let path;
const file = Gio.File.new_for_uri(uri);
const contentType = Gio.content_type_guess(file.get_path(), null)[0];
if (Gio.content_type_equals(contentType, 'image/jpeg') || Gio.content_type_equals(contentType, 'image/png') || Gio.content_type_equals(contentType, 'image/tiff')) {
const contentType = Gio.content_type_guess(file.get_basename(), null)[0];
if (
Gio.content_type_equals(contentType, 'image/jpeg') ||
Gio.content_type_equals(contentType, 'image/png') ||
Gio.content_type_equals(contentType, 'image/tiff')
) {
path = file.get_path();
} else if (Gio.content_type_equals(contentType, 'application/xml')) {
const decoder = new TextDecoder('utf-8');