Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.0.4点击主页再返回就一直转圈 #45

Open
luowenfu opened this issue Jan 11, 2024 · 1 comment
Open

1.0.4点击主页再返回就一直转圈 #45

luowenfu opened this issue Jan 11, 2024 · 1 comment

Comments

@luowenfu
Copy link

luowenfu commented Jan 11, 2024

很棒的插件,v1.0.4,先点击侧边栏的主页按钮后,再点击浏览器返回按钮,就一直转圈出不来了。
希望作者修复
emby版本:4.17.13
_20240114034401

@luowenfu
Copy link
Author

luowenfu commented Jan 14, 2024

经过自己尝试分析,问题出在:

		this.initStart = false;
		setInterval(() => {
			if (window.location.href.indexOf("!/home") != -1) {
				if ($(".view:not(.hide) .misty-banner").length == 0 && $(".misty-loading").length == 0) {
					this.initStart = false;
					this.initLoading();
				}
				if ($(".hide .misty-banner").length != 0) {
					$(".hide .misty-banner").remove();
				}
				if (!this.initStart && $(".section0 .card").length != 0 && $(".view:not(.hide) .misty-banner").length == 0) {
					this.initStart = true;
					this.init();
				}
			}
		}, 100);
		this.currentBannerIndex = 0;
		this.startAutoBannerRotation();
	}

	static async init() {
		// Beta
		$(".view:not(.hide)").attr("data-type", "home");
		// Loading
		const serverName = await this.injectCall("serverName", "");
		$(".misty-loading h1").text(serverName).addClass("active");
		// Banner
		await this.initBanner();
		this.initEvent();
	}

该问题在这段代码中。

我的临时解决办法:

				if ($(".hide .misty-banner").length != 0) {
					$(".hide .misty-banner").remove();
					// this.init();    //如果添加该段,点击返回后媒体库不显示。
					window.location.reload();  //只能添加一个刷新网页来临时解决

				}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant