|
@@ -28,6 +28,8 @@ export function clamp(value, min, max) {
|
|
|
return Math.min(Math.max(value, min), max);
|
|
|
}
|
|
|
|
|
|
-export function openURLInNewTab(url) {
|
|
|
- window.open(url, '_blank', 'noopener,noreferrer')?.focus();
|
|
|
+export function openURLInNewTab(url, focus = true) {
|
|
|
+ const newWindow = window.open(url, '_blank', 'noopener,noreferrer');
|
|
|
+
|
|
|
+ if (focus && newWindow != null) newWindow.focus();
|
|
|
}
|