mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
fix: resolve PR 877 issues - route params, artifact paths, and build configs
Fix route parameter name in use-initial-theme hook (communityAddress -> boardIdentifier), correct release workflow artifact paths (dist -> out/make), add BUILD_ARCH env var for Linux arm64 builds, fix macOS app name dev check, and update capacitor webDir to match vite output.
This commit is contained in:
@@ -32,7 +32,7 @@ jobs:
|
||||
run: yarn install --frozen-lockfile --ignore-engines
|
||||
# make sure the ipfs executable is executable
|
||||
- name: Download IPFS and set permissions (with Node v22)
|
||||
run: node electron/download-ipfs && sudo chmod +x bin/linux/ipfs
|
||||
run: BUILD_ARCH=${{ matrix.arch }} node electron/download-ipfs && sudo chmod +x bin/linux/ipfs
|
||||
- name: Build React app (with Node v22)
|
||||
run: CI='' NODE_ENV=production yarn build
|
||||
- name: Build Electron app for Linux (arm64)
|
||||
@@ -41,15 +41,15 @@ jobs:
|
||||
- name: Build Electron app for Linux (x64)
|
||||
if: ${{ matrix.arch == 'x64' }}
|
||||
run: yarn electron:build:linux:x64
|
||||
- name: List dist directory
|
||||
run: ls dist
|
||||
- name: List out directory
|
||||
run: ls -la out/make
|
||||
|
||||
# publish version release
|
||||
- name: Generate release body
|
||||
run: node scripts/release-body > release-body.txt
|
||||
- uses: ncipollo/release-action@v1
|
||||
with:
|
||||
artifacts: 'dist/5chan*.AppImage,dist/5chan*-arm64.AppImage,dist/5chan-html*.zip'
|
||||
artifacts: 'out/make/*.AppImage'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
replacesArtifacts: true
|
||||
omitBody: true
|
||||
@@ -104,15 +104,15 @@ jobs:
|
||||
else
|
||||
yarn electron:build:mac:x64
|
||||
fi
|
||||
- name: List dist directory
|
||||
run: ls dist
|
||||
- name: List out directory
|
||||
run: ls -la out/make
|
||||
|
||||
# publish version release
|
||||
- name: Generate release body
|
||||
run: node scripts/release-body > release-body.txt
|
||||
- uses: ncipollo/release-action@v1
|
||||
with:
|
||||
artifacts: 'dist/5chan*.dmg,dist/5chan*-arm64.dmg'
|
||||
artifacts: 'out/make/*.dmg,out/make/*.zip'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
replacesArtifacts: true
|
||||
omitBody: true
|
||||
@@ -138,15 +138,15 @@ jobs:
|
||||
run: npx cross-env NODE_ENV=production yarn build
|
||||
- name: Build Electron app for Windows (x64)
|
||||
run: yarn electron:build:windows
|
||||
- name: List dist directory
|
||||
run: dir dist
|
||||
- name: List out directory
|
||||
run: dir out\make\squirrel.windows\x64
|
||||
|
||||
# publish version release
|
||||
- name: Generate release body
|
||||
run: node scripts/release-body > release-body.txt
|
||||
- uses: ncipollo/release-action@v1
|
||||
with:
|
||||
artifacts: 'dist/5chan*.exe'
|
||||
artifacts: 'out/make/squirrel.windows/x64/*.exe'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
replacesArtifacts: true
|
||||
omitBody: true
|
||||
|
||||
+5
-5
@@ -3,13 +3,13 @@ import { CapacitorConfig } from '@capacitor/cli';
|
||||
const config: CapacitorConfig = {
|
||||
appId: 'fivechan.android',
|
||||
appName: '5chan',
|
||||
webDir: 'dist',
|
||||
webDir: 'build',
|
||||
plugins: {
|
||||
CapacitorHttp: {
|
||||
enabled: true,
|
||||
},
|
||||
FileUploader: {
|
||||
enabled: true
|
||||
enabled: true,
|
||||
},
|
||||
StatusBar: {
|
||||
style: 'Dark',
|
||||
@@ -21,8 +21,8 @@ const config: CapacitorConfig = {
|
||||
},
|
||||
},
|
||||
server: {
|
||||
androidScheme: 'https'
|
||||
}
|
||||
androidScheme: 'https',
|
||||
},
|
||||
};
|
||||
|
||||
export default config;
|
||||
export default config;
|
||||
|
||||
+1
-1
@@ -319,7 +319,7 @@ const createMainWindow = () => {
|
||||
|
||||
app.whenReady().then(() => {
|
||||
// Set app name and dock icon for development mode on macOS
|
||||
if (process.platform === 'darwin') {
|
||||
if (process.platform === 'darwin' && isDev) {
|
||||
app.setName('seedit');
|
||||
if (app.dock) {
|
||||
const iconPath = path.join(dirname, '..', isDev ? 'public' : 'build', 'icon.png');
|
||||
|
||||
@@ -3,11 +3,12 @@ import { useLocation, useParams } from 'react-router-dom';
|
||||
import useThemeStore from '../stores/use-theme-store';
|
||||
import { useDirectories } from './use-directories';
|
||||
import { isAllView, isHomeView, isNotFoundView, isPendingPostView, isSubscriptionsView, isModView } from '../lib/utils/view-utils';
|
||||
import { getSubplebbitAddress } from '../lib/utils/route-utils';
|
||||
import { useAccountComment } from '@plebbit/plebbit-react-hooks';
|
||||
|
||||
const useInitialTheme = (pendingPostSubplebbitAddress?: string) => {
|
||||
const location = useLocation();
|
||||
const { communityAddress: paramsSubplebbitAddress, accountCommentIndex } = useParams<{ communityAddress: string; accountCommentIndex?: string }>();
|
||||
const { boardIdentifier, accountCommentIndex } = useParams<{ boardIdentifier: string; accountCommentIndex?: string }>();
|
||||
const commentIndex = accountCommentIndex ? parseInt(accountCommentIndex) : undefined;
|
||||
const pendingPost = useAccountComment({ commentIndex });
|
||||
// Subscribe to the actual themes data, not just functions
|
||||
@@ -21,13 +22,15 @@ const useInitialTheme = (pendingPostSubplebbitAddress?: string) => {
|
||||
const isInModView = isModView(location.pathname);
|
||||
const isInPendingPostView = isPendingPostView(location.pathname, params);
|
||||
|
||||
const paramsSubplebbitAddress = boardIdentifier ? getSubplebbitAddress(boardIdentifier, directories) : undefined;
|
||||
|
||||
const initialTheme = useMemo(() => {
|
||||
let theme = 'yotsuba';
|
||||
|
||||
if (isInPendingPostView) {
|
||||
const communityAddress = pendingPostSubplebbitAddress || pendingPost?.communityAddress;
|
||||
if (communityAddress) {
|
||||
const community = directories.find((s) => s.address === communityAddress);
|
||||
const subplebbitAddress = pendingPostSubplebbitAddress || pendingPost?.subplebbitAddress;
|
||||
if (subplebbitAddress) {
|
||||
const community = directories.find((s) => s.address === subplebbitAddress);
|
||||
if (community?.nsfw) {
|
||||
theme = themes.nsfw || 'yotsuba';
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user