Update workflow actions (#649)

* Update workflow actions

* Fix tsc issues
This commit is contained in:
schroda
2024-03-09 00:24:48 +01:00
committed by GitHub
parent 550c576725
commit 2047d76ad9
5 changed files with 35 additions and 22 deletions

View File

@@ -6,7 +6,13 @@ jobs:
name: ci-pull-request
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up NodeJs
uses: actions/setup-node@v4
with:
node-version-file: 'package.json'
- name: Install modules
run: yarn

View File

@@ -13,19 +13,24 @@ jobs:
steps:
- name: Cancel previous runs
uses: styfle/cancel-workflow-action@0.9.0
uses: styfle/cancel-workflow-action@0.12.1
with:
access_token: ${{ github.token }}
- name: Checkout master branch
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
ref: master
path: master
fetch-depth: 0
- name: Set up NodeJs
uses: actions/setup-node@v4
with:
node-version-file: 'package.json'
- name: Cache node_modules
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: |
**/node_modules
@@ -49,7 +54,7 @@ jobs:
echo "::set-output name=value::$genTag"
- name: Checkout preview branch
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
repository: "Suwayomi/Suwayomi-WebUI-preview"
ref: main
@@ -81,7 +86,7 @@ jobs:
tag: ${{ steps.GenTagName.outputs.value }}
- name: Checkout github pages repo
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
repository: "Suwayomi-WebUI-preview/suwayomi-webui-preview.github.io"
ref: main

View File

@@ -11,13 +11,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Moderate issues
uses: tachiyomiorg/issue-moderator-action@v1
uses: tachiyomiorg/issue-moderator-action@v2
with:
repo-token: ${{ github.token }}
duplicate-check-enabled: true
duplicate-check-label: Source request
existing-check-enabled: true
existing-check-label: Source request
auto-close-rules: |
[
{

View File

@@ -281,7 +281,7 @@ export function ReaderNavBar(props: IProps) {
>
<Select
MenuProps={MenuProps}
value={chapter.pageCount > -1 ? curPage : ''}
value={chapter.pageCount > -1 ? `${curPage}` : ''}
displayEmpty
onChange={({ target: { value: selectedPage } }) => {
scrollToPage(Number(selectedPage));
@@ -316,7 +316,7 @@ export function ReaderNavBar(props: IProps) {
>
<Select
MenuProps={MenuProps}
value={chapter.sourceOrder >= 1 ? chapter.sourceOrder : ''}
value={chapter.sourceOrder >= 1 ? `${chapter.sourceOrder}` : ''}
displayEmpty
onChange={({ target: { value: selectedChapter } }) => {
navigate(`/manga/${manga.id}/chapter/${selectedChapter}`, {

View File

@@ -6,14 +6,14 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import { createElement, useState, useEffect } from 'react';
import { useState, useEffect, useMemo } from 'react';
import ListItem from '@mui/material/ListItem';
import ListItemText from '@mui/material/ListItemText';
import Switch from '@mui/material/Switch';
import Checkbox from '@mui/material/Checkbox';
import { CheckBoxPreferenceProps, SwitchPreferenceCompatProps, TwoStatePreferenceProps } from '@/typings';
function getTwoStateType(type: 'Checkbox' | 'Switch') {
function getTwoStateType(type: TwoStatePreferenceProps['twoStateType']) {
if (type === 'Switch') {
return Switch;
}
@@ -53,10 +53,13 @@ function TwoSatePreference(props: TwoStatePreferenceProps) {
setInternalCurrentValue(currentValue ?? defaultValue);
}, [currentValue]);
const TwoStateComponent = useMemo(() => getTwoStateType(twoStateType), [twoStateType]);
return (
<ListItem>
<ListItemText primary={title} secondary={summary} />
{createElement(getTwoStateType(twoStateType), {
<TwoStateComponent
{...{
edge: 'end',
checked: internalCurrentValue,
onChange: () => {
@@ -65,7 +68,8 @@ function TwoSatePreference(props: TwoStatePreferenceProps) {
// appear smooth
setInternalCurrentValue(!currentValue);
},
})}
}}
/>
</ListItem>
);
}