mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2024-09-22 16:26:18 +08:00
Merge pull request #1327 from Estebene/bug-command-theme
Fixed command line random theme bug #1326
This commit is contained in:
commit
4b9c6adae2
|
@ -16,7 +16,7 @@ function showInput(command, placeholder, defaultValue = "") {
|
|||
$("#commandInput input").focus();
|
||||
$("#commandInput input").attr("command", "");
|
||||
$("#commandInput input").attr("command", command);
|
||||
if (defaultValue != ""){
|
||||
if (defaultValue != "") {
|
||||
$("#commandInput input").select();
|
||||
}
|
||||
}
|
||||
|
@ -46,7 +46,10 @@ function showFound() {
|
|||
try {
|
||||
$.each(list.list, (index, obj) => {
|
||||
if (obj.found) {
|
||||
if (!/theme/gi.test(obj.id) || obj.id === "toggleCustomTheme")
|
||||
if (
|
||||
(!/theme/gi.test(obj.id) || obj.id === "toggleCustomTheme") &&
|
||||
!ThemeController.randomTheme
|
||||
)
|
||||
ThemeController.clearPreview();
|
||||
if (!/font/gi.test(obj.id))
|
||||
UpdateConfig.previewFontFamily(Config.fontFamily);
|
||||
|
@ -118,7 +121,9 @@ function updateSuggested() {
|
|||
function hide() {
|
||||
UpdateConfig.previewFontFamily(Config.fontFamily);
|
||||
// applyCustomThemeColors();
|
||||
ThemeController.clearPreview();
|
||||
if (!ThemeController.randomTheme) {
|
||||
ThemeController.clearPreview();
|
||||
}
|
||||
$("#commandLineWrapper")
|
||||
.stop(true, true)
|
||||
.css("opacity", 1)
|
||||
|
|
|
@ -6,7 +6,7 @@ import Config from "./config";
|
|||
import * as UI from "./ui";
|
||||
|
||||
let isPreviewingTheme = false;
|
||||
let randomTheme = null;
|
||||
export let randomTheme = null;
|
||||
|
||||
export const colorVars = [
|
||||
"--bg-color",
|
||||
|
|
Loading…
Reference in a new issue