Update workflow actions (#649)
* Update workflow actions * Fix tsc issues
This commit is contained in:
8
.github/workflows/build_pull_request.yml
vendored
8
.github/workflows/build_pull_request.yml
vendored
@@ -6,7 +6,13 @@ jobs:
|
|||||||
name: ci-pull-request
|
name: ci-pull-request
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
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
|
- name: Install modules
|
||||||
run: yarn
|
run: yarn
|
||||||
|
|
||||||
|
|||||||
15
.github/workflows/build_push_master.yml
vendored
15
.github/workflows/build_push_master.yml
vendored
@@ -13,19 +13,24 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Cancel previous runs
|
- name: Cancel previous runs
|
||||||
uses: styfle/cancel-workflow-action@0.9.0
|
uses: styfle/cancel-workflow-action@0.12.1
|
||||||
with:
|
with:
|
||||||
access_token: ${{ github.token }}
|
access_token: ${{ github.token }}
|
||||||
|
|
||||||
- name: Checkout master branch
|
- name: Checkout master branch
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
ref: master
|
ref: master
|
||||||
path: master
|
path: master
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Set up NodeJs
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version-file: 'package.json'
|
||||||
|
|
||||||
- name: Cache node_modules
|
- name: Cache node_modules
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
**/node_modules
|
**/node_modules
|
||||||
@@ -49,7 +54,7 @@ jobs:
|
|||||||
echo "::set-output name=value::$genTag"
|
echo "::set-output name=value::$genTag"
|
||||||
|
|
||||||
- name: Checkout preview branch
|
- name: Checkout preview branch
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
repository: "Suwayomi/Suwayomi-WebUI-preview"
|
repository: "Suwayomi/Suwayomi-WebUI-preview"
|
||||||
ref: main
|
ref: main
|
||||||
@@ -81,7 +86,7 @@ jobs:
|
|||||||
tag: ${{ steps.GenTagName.outputs.value }}
|
tag: ${{ steps.GenTagName.outputs.value }}
|
||||||
|
|
||||||
- name: Checkout github pages repo
|
- name: Checkout github pages repo
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
repository: "Suwayomi-WebUI-preview/suwayomi-webui-preview.github.io"
|
repository: "Suwayomi-WebUI-preview/suwayomi-webui-preview.github.io"
|
||||||
ref: main
|
ref: main
|
||||||
|
|||||||
4
.github/workflows/issue_moderator.yml
vendored
4
.github/workflows/issue_moderator.yml
vendored
@@ -11,13 +11,11 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Moderate issues
|
- name: Moderate issues
|
||||||
uses: tachiyomiorg/issue-moderator-action@v1
|
uses: tachiyomiorg/issue-moderator-action@v2
|
||||||
with:
|
with:
|
||||||
repo-token: ${{ github.token }}
|
repo-token: ${{ github.token }}
|
||||||
duplicate-check-enabled: true
|
duplicate-check-enabled: true
|
||||||
duplicate-check-label: Source request
|
|
||||||
existing-check-enabled: true
|
existing-check-enabled: true
|
||||||
existing-check-label: Source request
|
|
||||||
auto-close-rules: |
|
auto-close-rules: |
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -281,7 +281,7 @@ export function ReaderNavBar(props: IProps) {
|
|||||||
>
|
>
|
||||||
<Select
|
<Select
|
||||||
MenuProps={MenuProps}
|
MenuProps={MenuProps}
|
||||||
value={chapter.pageCount > -1 ? curPage : ''}
|
value={chapter.pageCount > -1 ? `${curPage}` : ''}
|
||||||
displayEmpty
|
displayEmpty
|
||||||
onChange={({ target: { value: selectedPage } }) => {
|
onChange={({ target: { value: selectedPage } }) => {
|
||||||
scrollToPage(Number(selectedPage));
|
scrollToPage(Number(selectedPage));
|
||||||
@@ -316,7 +316,7 @@ export function ReaderNavBar(props: IProps) {
|
|||||||
>
|
>
|
||||||
<Select
|
<Select
|
||||||
MenuProps={MenuProps}
|
MenuProps={MenuProps}
|
||||||
value={chapter.sourceOrder >= 1 ? chapter.sourceOrder : ''}
|
value={chapter.sourceOrder >= 1 ? `${chapter.sourceOrder}` : ''}
|
||||||
displayEmpty
|
displayEmpty
|
||||||
onChange={({ target: { value: selectedChapter } }) => {
|
onChange={({ target: { value: selectedChapter } }) => {
|
||||||
navigate(`/manga/${manga.id}/chapter/${selectedChapter}`, {
|
navigate(`/manga/${manga.id}/chapter/${selectedChapter}`, {
|
||||||
|
|||||||
@@ -6,14 +6,14 @@
|
|||||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
* 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 ListItem from '@mui/material/ListItem';
|
||||||
import ListItemText from '@mui/material/ListItemText';
|
import ListItemText from '@mui/material/ListItemText';
|
||||||
import Switch from '@mui/material/Switch';
|
import Switch from '@mui/material/Switch';
|
||||||
import Checkbox from '@mui/material/Checkbox';
|
import Checkbox from '@mui/material/Checkbox';
|
||||||
import { CheckBoxPreferenceProps, SwitchPreferenceCompatProps, TwoStatePreferenceProps } from '@/typings';
|
import { CheckBoxPreferenceProps, SwitchPreferenceCompatProps, TwoStatePreferenceProps } from '@/typings';
|
||||||
|
|
||||||
function getTwoStateType(type: 'Checkbox' | 'Switch') {
|
function getTwoStateType(type: TwoStatePreferenceProps['twoStateType']) {
|
||||||
if (type === 'Switch') {
|
if (type === 'Switch') {
|
||||||
return Switch;
|
return Switch;
|
||||||
}
|
}
|
||||||
@@ -53,19 +53,23 @@ function TwoSatePreference(props: TwoStatePreferenceProps) {
|
|||||||
setInternalCurrentValue(currentValue ?? defaultValue);
|
setInternalCurrentValue(currentValue ?? defaultValue);
|
||||||
}, [currentValue]);
|
}, [currentValue]);
|
||||||
|
|
||||||
|
const TwoStateComponent = useMemo(() => getTwoStateType(twoStateType), [twoStateType]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ListItem>
|
<ListItem>
|
||||||
<ListItemText primary={title} secondary={summary} />
|
<ListItemText primary={title} secondary={summary} />
|
||||||
{createElement(getTwoStateType(twoStateType), {
|
<TwoStateComponent
|
||||||
edge: 'end',
|
{...{
|
||||||
checked: internalCurrentValue,
|
edge: 'end',
|
||||||
onChange: () => {
|
checked: internalCurrentValue,
|
||||||
updateValue(twoStateType === 'Switch' ? 'switchState' : 'checkBoxState', !currentValue);
|
onChange: () => {
|
||||||
|
updateValue(twoStateType === 'Switch' ? 'switchState' : 'checkBoxState', !currentValue);
|
||||||
|
|
||||||
// appear smooth
|
// appear smooth
|
||||||
setInternalCurrentValue(!currentValue);
|
setInternalCurrentValue(!currentValue);
|
||||||
},
|
},
|
||||||
})}
|
}}
|
||||||
|
/>
|
||||||
</ListItem>
|
</ListItem>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user