Added thumbnails and updated background pages

This commit is contained in:
Sean Edmunds
2025-07-21 16:28:43 -05:00
parent 2a53d9f16a
commit 063bc10094
12 changed files with 603 additions and 392 deletions

View File

@@ -125,6 +125,48 @@ export function useCommonHooks() {
return k;
}
function getObjectDiff(original: any, current: any) {
const changes: any = {};
// Check current object's properties
for (const [key, value] of Object.entries(current)) {
if (!(key in original)) {
changes[key] = {
oldValue: undefined,
newValue: value,
};
continue;
}
const originalValue = original[key];
const currentValue = value;
// Handle different types of comparisons
if (
originalValue !== currentValue &&
String(originalValue) !== String(currentValue) &&
JSON.stringify(originalValue) !== JSON.stringify(currentValue)
) {
changes[key] = {
oldValue: originalValue,
newValue: currentValue,
};
}
}
// Check for removed properties
for (const key of Object.keys(original)) {
if (!(key in current)) {
changes[key] = {
oldValue: original[key],
newValue: undefined,
};
}
}
return Object.keys(changes).length === 0 ? null : changes;
}
return {
isMobile,
theme,
@@ -132,6 +174,7 @@ export function useCommonHooks() {
urlPattern,
fixDigits,
reorder,
getObjectDiff,
handleThemeChange,
handleDelete,
themeName,