mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-01-04 18:59:08 +01:00
default white bg for websites with no bg (#355)
This commit is contained in:
parent
62eb04090a
commit
a9486852f9
@ -12,6 +12,7 @@ import clsx from "clsx";
|
|||||||
import { WebviewTag } from "electron";
|
import { WebviewTag } from "electron";
|
||||||
import * as jotai from "jotai";
|
import * as jotai from "jotai";
|
||||||
import React, { memo, useEffect, useState } from "react";
|
import React, { memo, useEffect, useState } from "react";
|
||||||
|
import { debounce } from "throttle-debounce";
|
||||||
import "./webview.less";
|
import "./webview.less";
|
||||||
|
|
||||||
export class WebViewModel implements ViewModel {
|
export class WebViewModel implements ViewModel {
|
||||||
@ -385,10 +386,14 @@ const WebView = memo(({ model }: WebViewProps) => {
|
|||||||
const startLoadingHandler = () => {
|
const startLoadingHandler = () => {
|
||||||
model.setRefreshIcon("xmark-large");
|
model.setRefreshIcon("xmark-large");
|
||||||
model.setIsLoading(true);
|
model.setIsLoading(true);
|
||||||
|
webview.style.backgroundColor = "transparent";
|
||||||
};
|
};
|
||||||
const stopLoadingHandler = () => {
|
const stopLoadingHandler = () => {
|
||||||
model.setRefreshIcon("rotate-right");
|
model.setRefreshIcon("rotate-right");
|
||||||
model.setIsLoading(false);
|
model.setIsLoading(false);
|
||||||
|
debounce(1000, () => {
|
||||||
|
webview.style.backgroundColor = "white";
|
||||||
|
})();
|
||||||
};
|
};
|
||||||
const failLoadHandler = (e: any) => {
|
const failLoadHandler = (e: any) => {
|
||||||
if (e.errorCode === -3) {
|
if (e.errorCode === -3) {
|
||||||
|
Loading…
Reference in New Issue
Block a user