mirror of
https://github.com/NoCrypt/migu.git
synced 2026-03-30 14:28:48 +00:00
fix: flashing on load
fix: menubar on electron fix: sections loading errors fix: changelog styling fix: restore settings
This commit is contained in:
parent
88ab29e6a1
commit
52b1aa6608
10 changed files with 35 additions and 18 deletions
|
|
@ -29,6 +29,9 @@
|
|||
</div>
|
||||
|
||||
<style>
|
||||
.navbar {
|
||||
--navbar-height: 28px !important;
|
||||
}
|
||||
.z-101 {
|
||||
z-index: 101 !important
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
:root {
|
||||
--navbar-height: 28px;
|
||||
--accent-color: #e5204c;
|
||||
--dm-link-text-color: var(--dm-muted-text-color) !important;
|
||||
--dm-link-text-color-hover: var(--dm-text-color) !important;
|
||||
|
|
@ -26,6 +25,9 @@
|
|||
--safe-area-left: 0px;
|
||||
color-scheme: dark;
|
||||
}
|
||||
.dark-mode {
|
||||
background-color: var(--dark-color) !important;
|
||||
}
|
||||
|
||||
@media (min-width: 769px) {
|
||||
:root {
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ settings.subscribe(() => {
|
|||
function createSections () {
|
||||
return [
|
||||
// RSS feeds
|
||||
...[...settings.value.rssFeedsNew].reverse().map(([title, url]) => {
|
||||
...settings.value.rssFeedsNew.map(([title, url]) => {
|
||||
const section = {
|
||||
title,
|
||||
load: (page = 1, perPage = 8) => RSSManager.getMediaForRSS(page, perPage, url),
|
||||
|
|
|
|||
|
|
@ -5,12 +5,18 @@ export let alToken = localStorage.getItem('ALtoken') || null
|
|||
|
||||
let storedSettings = { ...defaults }
|
||||
|
||||
let scopedDefaults = { ...defaults }
|
||||
|
||||
try {
|
||||
storedSettings = JSON.parse(localStorage.getItem('settings')) || { ...defaults }
|
||||
} catch (e) {}
|
||||
|
||||
const scopedDefaults = {
|
||||
homeSections: [...[...storedSettings.rssFeedsNew.reverse()].map(([title]) => title), 'Continue Watching', 'Sequels You Missed', 'Your List', 'Popular This Season', 'Trending Now', 'All Time Popular', 'Romance', 'Action', 'Adventure', 'Fantasy', 'Comedy']
|
||||
try {
|
||||
scopedDefaults = {
|
||||
homeSections: [...(storedSettings.rssFeedsNew || defaults.rssFeedsNew).map(([title]) => title), 'Continue Watching', 'Sequels You Missed', 'Your List', 'Popular This Season', 'Trending Now', 'All Time Popular', 'Romance', 'Action', 'Adventure', 'Fantasy', 'Comedy']
|
||||
}
|
||||
} catch (e) {
|
||||
resetSettings()
|
||||
location.reload()
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -157,7 +157,7 @@ export const defaults = {
|
|||
dhtPort: 0,
|
||||
missingFont: true,
|
||||
maxConns: 50,
|
||||
subtitleRenderHeight: 0,
|
||||
subtitleRenderHeight: '0',
|
||||
subtitleLanguage: 'eng',
|
||||
audioLanguage: 'jpn',
|
||||
enableDoH: false,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<script context='module'>
|
||||
import SectionsManager, { sections } from '@/modules/sections.js'
|
||||
import { settings } from '@/modules/settings.js'
|
||||
import { alToken, settings } from '@/modules/settings.js'
|
||||
import { alRequest, currentSeason, currentYear, userLists } from '@/modules/anilist.js'
|
||||
|
||||
const bannerData = alRequest({ method: 'Search', sort: 'POPULARITY_DESC', perPage: 1, onList: false, season: currentSeason, year: currentYear })
|
||||
|
|
@ -15,14 +15,16 @@
|
|||
|
||||
for (const sectionTitle of settings.value.homeSections) manager.add(mappedSections[sectionTitle])
|
||||
|
||||
const userSections = ['Continue Watching', 'Sequels You Missed', 'Your List', 'Completed List', 'Paused List', 'Dropped List', 'Currently Watching List']
|
||||
if (alToken) {
|
||||
const userSections = ['Continue Watching', 'Sequels You Missed', 'Your List', 'Completed List', 'Paused List', 'Dropped List', 'Currently Watching List']
|
||||
|
||||
userLists.subscribe(() => {
|
||||
for (const section of manager.sections) {
|
||||
// remove preview value, to force UI to re-request data, which updates it once in viewport
|
||||
if (userSections.includes(section.title)) section.preview.value = undefined
|
||||
}
|
||||
})
|
||||
userLists.subscribe(() => {
|
||||
for (const section of manager.sections) {
|
||||
// remove preview value, to force UI to re-request data, which updates it once in viewport
|
||||
if (userSections.includes(section.title)) section.preview.value = section.load(1, 15)
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
|
|
|
|||
|
|
@ -16,6 +16,10 @@
|
|||
duration: 5000
|
||||
})
|
||||
}
|
||||
function restoreSettigs () {
|
||||
resetSettings()
|
||||
location.reload()
|
||||
}
|
||||
function checkUpdate () {
|
||||
IPC.emit('update')
|
||||
}
|
||||
|
|
@ -43,7 +47,7 @@
|
|||
</button>
|
||||
{/if}
|
||||
<button
|
||||
use:click={resetSettings}
|
||||
use:click={restoreSettigs}
|
||||
class='btn btn-danger mx-20 mt-10'
|
||||
type='button'
|
||||
data-toggle='tooltip'
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@
|
|||
</div>
|
||||
</SettingCard>
|
||||
<SettingCard title='Sections And Order' description="Sections and their order on the home screen, if you want more RSS feeds to show up here, create them first in the RSS feed list. Adding many multiple normal lists doesn't impact performance, but adding a lot of RSS feeds will impact app startup times. Drag/drop these sections to re-order them.">
|
||||
<div>
|
||||
<div class='position-relative'>
|
||||
<HomeSections bind:homeSections={settings.homeSections} />
|
||||
</div>
|
||||
</SettingCard>
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@
|
|||
</div>
|
||||
</Tab>
|
||||
<Tab>
|
||||
<div class='root m-20 px-20 pre-wrap overflow-y-md-auto'>
|
||||
<div class='root my-20 px-20 pre-wrap overflow-y-md-auto w-full'>
|
||||
{#await changeLog}
|
||||
<h1 class='font-weight-bold'>Loading changelog...</h1>
|
||||
{:then changes}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "Miru",
|
||||
"version": "4.4.18",
|
||||
"version": "4.5.0",
|
||||
"private": true,
|
||||
"author": "ThaUnknown_ <ThaUnknown@users.noreply.github.com>",
|
||||
"description": "Stream anime torrents, real-time with no waiting for downloads.",
|
||||
|
|
|
|||
Loading…
Reference in a new issue