Skip to content

Commit

Permalink
alpha release build 0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
yang991178 committed Jun 15, 2020
1 parent 06a08e3 commit f017bce
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 7 deletions.
10 changes: 8 additions & 2 deletions package.json
@@ -1,13 +1,13 @@
{
"name": "fluent-reader",
"version": "0.1.0",
"version": "0.2.0",
"description": "A simplistic, modern desktop RSS reader",
"main": "./dist/electron.js",
"scripts": {
"build": "webpack --config ./webpack.config.js",
"electron": "electron ./dist/electron.js",
"start": "npm run build && npm run electron",
"package-win": "electron-builder -w --x64 && electron-builder -w --ia32 && electron-builder -w --arm64",
"package-win": "electron-builder -w --x64 && electron-builder -w --ia32 && electron-builder -w appx:arm64",
"package-mac": "sudo electron-builder --mac"
},
"keywords": [],
Expand Down Expand Up @@ -36,6 +36,12 @@
"showNameOnTiles": true,
"setBuildNumber": true
},
"nsis": {
"oneClick": false,
"perMachine": true,
"allowToChangeInstallationDirectory": true,
"deleteAppDataOnUninstall": true
},
"mac": {
"target": [ "dmg" ]
}
Expand Down
3 changes: 2 additions & 1 deletion src/components/settings/about.tsx
Expand Up @@ -2,14 +2,15 @@ import * as React from "react"
import intl = require("react-intl-universal")
import { Stack, Link } from "@fluentui/react"
import { openExternal } from "../../scripts/utils"
import { remote } from "electron"

class AboutTab extends React.Component {
render = () => (
<div className="tab-body">
<Stack className="settings-about" horizontalAlign="center">
<img src="logo.svg" style={{width: 120, height: 120}} />
<h3>Fluent Reader</h3>
<small>{intl.get("settings.version")} 0.1.0</small>
<small>{intl.get("settings.version")} {remote.app.getVersion()}</small>
<p className="settings-hint">Copyright © 2020 Haoyuan Liu. All rights reserved.</p>
<Stack horizontal horizontalAlign="center" tokens={{childrenGap: 12}}>
<small><Link onClick={() => openExternal("https://github.com/yang991178/fluent-reader")}>{intl.get("settings.openSource")}</Link></small>
Expand Down
4 changes: 3 additions & 1 deletion src/electron.ts
@@ -1,10 +1,12 @@
import { app, ipcMain, BrowserWindow, Menu, nativeTheme } from "electron"
import windowStateKeeper = require("electron-window-state")
import Store = require("electron-store")
import performUpdate from "./scripts/update-scripts"

let mainWindow: BrowserWindow
let store = new Store()
let restarting = false
performUpdate(store)
nativeTheme.themeSource = store.get("theme", "system")

function createWindow() {
Expand Down Expand Up @@ -35,7 +37,7 @@ function createWindow() {
mainWindow.on("ready-to-show", () => {
mainWindow.show()
mainWindow.focus()
mainWindow.webContents.openDevTools()
if (!app.isPackaged) mainWindow.webContents.openDevTools()
});
// and load the index.html of the app.
mainWindow.loadFile((app.isPackaged ? "dist/" : "") + "index.html")
Expand Down
1 change: 1 addition & 0 deletions src/scripts/config-schema.ts
Expand Up @@ -20,4 +20,5 @@ export type schemaTypes = {
locale: string
sourceGroups: SourceGroup[]
fontSize: number
menuOn: boolean
}
12 changes: 9 additions & 3 deletions src/scripts/models/app.ts
Expand Up @@ -5,7 +5,7 @@ import { ActionStatus, AppThunk, getWindowBreakpoint } from "../utils"
import { INIT_FEEDS, FeedActionTypes, ALL, initFeeds } from "./feed"
import { SourceGroupActionTypes, UPDATE_SOURCE_GROUP, ADD_SOURCE_TO_GROUP, DELETE_SOURCE_GROUP, REMOVE_SOURCE_FROM_GROUP, REORDER_SOURCE_GROUPS } from "./group"
import { PageActionTypes, SELECT_PAGE, PageType, selectAllArticles } from "./page"
import { getCurrentLocale } from "../settings"
import { getCurrentLocale, setDefaultMenu, getDefaultMenu } from "../settings"
import locales from "../i18n/_locales"
import * as db from "../db"

Expand Down Expand Up @@ -38,7 +38,7 @@ export class AppState {
fetchingItems = false
fetchingProgress = 0
fetchingTotal = 0
menu = getWindowBreakpoint()
menu = getWindowBreakpoint() && getDefaultMenu()
menuKey = ALL
title = ""
settings = {
Expand Down Expand Up @@ -149,7 +149,13 @@ export function openGroupMenu(sids: number[], event: React.MouseEvent): ContextM
}
}

export const toggleMenu = () => ({ type: TOGGLE_MENU })
export function toggleMenu(): AppThunk {
return (dispatch, getState) => {
dispatch({ type: TOGGLE_MENU })
setDefaultMenu(getState().app.menu)
}
}

export const toggleLogMenu = () => ({ type: TOGGLE_LOGS })
export const toggleSettings = () => ({ type: TOGGLE_SETTINGS })
export const saveSettings = () => ({ type: SAVE_SETTINGS })
Expand Down
8 changes: 8 additions & 0 deletions src/scripts/settings.ts
Expand Up @@ -9,6 +9,14 @@ import intl = require("react-intl-universal")

export const store = new Store<schemaTypes>()

const MENU_STORE_KEY = "menuOn"
export function getDefaultMenu() {
return store.get(MENU_STORE_KEY, false)
}
export function setDefaultMenu(state: boolean) {
store.set(MENU_STORE_KEY, state)
}

const PAC_STORE_KEY = "pac"
const PAC_STATUS_KEY = "pacOn"
export function getProxyStatus() {
Expand Down
3 changes: 3 additions & 0 deletions webpack.config.js
Expand Up @@ -9,6 +9,9 @@ module.exports = [
rules: [{
test: /\.ts$/,
include: /src/,
resolve: {
extensions: ['.ts', '.js']
},
use: [{ loader: 'ts-loader' }]
}]
},
Expand Down

0 comments on commit f017bce

Please sign in to comment.