Skip to content

Commit

Permalink
Merge pull request #1990 from Yidadaa/bugfix-0615
Browse files Browse the repository at this point in the history
fix: #1982 should not fullscreen on standlone build
  • Loading branch information
Yidadaa authored Jun 15, 2023
2 parents 9d1a848 + 91b871e commit c4921f3
Show file tree
Hide file tree
Showing 14 changed files with 346 additions and 18 deletions.
1 change: 1 addition & 0 deletions .github/workflows/app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ jobs:
- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
with:
releaseId: ${{ needs.create-release.outputs.release_id }}

Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,6 @@ dev

# docker-compose env files
.env

*.key
*.key.pub
7 changes: 6 additions & 1 deletion app/client/api.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { getClientConfig } from "../config/client";
import { ACCESS_CODE_PREFIX } from "../constant";
import { ChatMessage, ModelType, useAccessStore } from "../store";
import { ChatGPTApi } from "./platforms/openai";
Expand Down Expand Up @@ -93,7 +94,11 @@ export class ClientApi {
// Please do not modify this message

console.log("[Share]", msgs);
const res = await fetch("/sharegpt", {
const clientConfig = getClientConfig();
const proxyUrl = "/sharegpt";
const rawUrl = "https://sharegpt.com/api/conversations";
const shareUrl = clientConfig?.isApp ? rawUrl : proxyUrl;
const res = await fetch(shareUrl, {
body: JSON.stringify({
avatarUrl,
items: msgs,
Expand Down
2 changes: 1 addition & 1 deletion app/components/chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ export function Chat() {

return (
<div className={styles.chat} key={session.id}>
<div className="window-header">
<div className="window-header" data-tauri-drag-region>
<div className="window-header-title">
<div
className={`window-header-main-title " ${styles["chat-body-title"]}`}
Expand Down
2 changes: 1 addition & 1 deletion app/components/settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ export function Settings() {

return (
<ErrorBoundary>
<div className="window-header">
<div className="window-header" data-tauri-drag-region>
<div className="window-header-title">
<div className="window-header-main-title">
{Locale.Settings.Title}
Expand Down
6 changes: 4 additions & 2 deletions app/components/sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,10 @@ export function SideBar(props: { className?: string }) {
shouldNarrow && styles["narrow-sidebar"]
}`}
>
<div className={styles["sidebar-header"]}>
<div className={styles["sidebar-title"]}>ChatGPT Next</div>
<div className={styles["sidebar-header"]} data-tauri-drag-region>
<div className={styles["sidebar-title"]} data-tauri-drag-region>
ChatGPT Next
</div>
<div className={styles["sidebar-sub-title"]}>
Build your own AI assistant.
</div>
Expand Down
1 change: 0 additions & 1 deletion app/locales/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ function getLanguage() {
try {
return navigator.language.toLowerCase();
} catch {
console.log("[Lang] failed to detect user lang.");
return DEFAULT_LANG;
}
}
Expand Down
4 changes: 2 additions & 2 deletions app/store/config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { create } from "zustand";
import { persist } from "zustand/middleware";
import { getClientConfig } from "../config/client";
import { StoreKey } from "../constant";
import { getBuildConfig } from "../config/build";

export enum SubmitKey {
Enter = "Enter",
Expand All @@ -22,7 +22,7 @@ export const DEFAULT_CONFIG = {
avatar: "1f603",
fontSize: 14,
theme: Theme.Auto as Theme,
tightBorder: !getBuildConfig().isApp,
tightBorder: !!getClientConfig()?.isApp,
sendPreviewBubble: true,
sidebarWidth: 300,

Expand Down
2 changes: 1 addition & 1 deletion app/styles/markdown.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1116,4 +1116,4 @@

.markdown-body ::-webkit-calendar-picker-indicator {
filter: invert(50%);
}
}
3 changes: 3 additions & 0 deletions next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ const nextConfig = {
return config;
},
output: mode,
images: {
unoptimized: mode === "export",
},
};

if (mode !== "export") {
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
"remark-gfm": "^3.0.1",
"remark-math": "^5.1.1",
"sass": "^1.59.2",
"sharp": "^0.32.1",
"spark-md5": "^3.0.2",
"use-debounce": "^9.0.3",
"zustand": "^4.3.6"
Expand Down
Loading

0 comments on commit c4921f3

Please sign in to comment.