Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/features/painter/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const paint = postElements => filterPostElements(postElements, { excludeClass })
try {
const { response: { tags: sourceTags } } = await apiFetch(`/v2/blog/${rebloggedRootUuid}/posts/${rebloggedRootId}`);
if (sourceTags.some(tag => tagArray.includes(tag.toLowerCase()))) coloursToApply.push(tagColour);
} catch (exception) {
} catch {
// The source post can't be found, so we can't extract tags from it either.
// This means we don't have to do anything else with it, and we can quit quietly.
}
Expand Down
4 changes: 2 additions & 2 deletions src/features/quick_tags/options/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const editTagBundle = async ({ currentTarget }) => {
currentTarget.firstElementChild.className = 'ri-pencil-line';

const { [storageKey]: tagBundles = [] } = await browser.storage.local.get(storageKey);
const index = parseInt(parentNode.id);
const index = parseInt(parentNode.id, 10);
const tagBundle = tagBundles[index];

for (const input of inputs) {
Expand All @@ -70,7 +70,7 @@ const deleteBundle = async ({ currentTarget }) => {
const { parentNode: { parentNode } } = currentTarget;

const { [storageKey]: tagBundles = [] } = await browser.storage.local.get(storageKey);
const index = parseInt(parentNode.id);
const index = parseInt(parentNode.id, 10);
tagBundles.splice(index, 1);
browser.storage.local.set({ [storageKey]: tagBundles });
};
Expand Down
2 changes: 1 addition & 1 deletion src/features/scroll_to_bottom/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const styleElement = buildStyle(`

let timeoutID;

const onLoadersAdded = loaders => {
const onLoadersAdded = () => {
if (active) {
clearTimeout(timeoutID);
}
Expand Down
2 changes: 1 addition & 1 deletion src/features/timeformat/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ const thresholds = [
];

const constructRelativeTimeString = function (unixTime) {
const now = Math.trunc(new Date().getTime() / 1000);
const now = Math.trunc(Date.now() / 1000);
const unixDiff = unixTime - now;
const unixDiffAbsolute = Math.abs(unixDiff);

Expand Down
4 changes: 2 additions & 2 deletions src/features/timestamps/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ const constructISOString = function (unixTime) {
};

const constructRelativeTimeString = function (unixTime) {
const now = Math.trunc(new Date().getTime() / 1000);
const now = Math.trunc(Date.now() / 1000);
const unixDiff = unixTime - now;
const unixDiffAbsolute = Math.abs(unixDiff);

Expand Down Expand Up @@ -175,7 +175,7 @@ const addReblogTimestamps = async function () {
timestampElement.textContent = constructTimeString(result);
timestampElement.title = constructRelativeTimeString(result);
}).catch(exception => {
timestampElement.textContent = (exception.body && exception.body.meta) ? exception.body.meta.msg : '';
timestampElement.textContent = exception.body?.meta?.msg ?? '';
});
});
});
Expand Down