mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 07:52:24 +00:00
[constants] refactor duplicate numeric constants
- Add `UI_FEEDBACK_DELAY_MS`, `DEBOUNCE_DELAY_MS`, and `NETWORK_RETRY_DELAY_MS` to `js/constants.js`. - Replace magic numbers (5000, 2000, 1500) with semantic constants in: - `js/ui/notificationController.js` - `js/ui/profileModal/ProfileDirectMessageActions.js` - `js/ui/urlHealthController.js` - `js/app/uiCoordinator.js` - `js/ui/components/VideoModal.js` - `js/ui/components/UploadModal.js` - `js/services/dmNostrService.js` - `js/services/hashtagPreferencesService.js` - `js/app/feedCoordinator.js` - `js/services/moderationService.js` Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
1 parent
a090864bc2
commit
2aae4094e7
11 files changed
+35
-20
No files matched your search
@@ -23,6 +23,7 @@ import {
|
||||
getActiveSigner,
|
||||
requestDefaultExtensionPermissions,
|
||||
} from "../../nostrClientFacade.js";
|
||||
import { UI_FEEDBACK_DELAY_MS } from "../../constants.js";
|
||||
|
||||
const INFO_HASH_PATTERN = /^[a-f0-9]{40}$/;
|
||||
|
||||
@@ -790,7 +791,7 @@ export class UploadModal {
|
||||
if (this.thumbnailUploadId === currentUploadId) {
|
||||
this.sourceSections.thumbnailProgress.classList.add("hidden");
|
||||
}
|
||||
}, 2000);
|
||||
}, UI_FEEDBACK_DELAY_MS);
|
||||
|
||||
} catch (err) {
|
||||
if (this.thumbnailUploadId !== currentUploadId) return;
|
||||
|
||||
@@ -47,6 +47,7 @@ import {
|
||||
subscribeToLinkPreviewSettings,
|
||||
} from "../../utils/linkPreviewSettings.js";
|
||||
import { HEX64_REGEX } from "../../utils/hex.js";
|
||||
import { UI_FEEDBACK_DELAY_MS } from "../../constants.js";
|
||||
|
||||
|
||||
const SIMILAR_CONTENT_LIMIT = 10;
|
||||
@@ -1534,7 +1535,7 @@ export class VideoModal {
|
||||
if (button.dataset.feedbackTimeoutId) {
|
||||
delete button.dataset.feedbackTimeoutId;
|
||||
}
|
||||
}, 2000);
|
||||
}, UI_FEEDBACK_DELAY_MS);
|
||||
|
||||
button.dataset.feedbackTimeoutId = String(nextId);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user