Skip to content

Commit

Permalink
fix: liff init
Browse files Browse the repository at this point in the history
  • Loading branch information
PMinn committed Mar 23, 2024
1 parent 26f7d67 commit e94e78f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
7 changes: 4 additions & 3 deletions pages/line/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,14 @@ export default function Form() {
var liffId = "1655168208-29vA01a6";
try {
if (process?.env?.SETTINGS_LIFF_ID) liffId = process.env.SETTINGS_LIFF_ID;
else if (context.type == "none" || context.type == "external") {
} catch { }
const context = await liff_init(liffId);
try {
if (!process?.env?.SETTINGS_LIFF_ID && (context.type == "none" || context.type == "external")) {
alert("請使用正常路徑開啟");
return;
}
} catch { }
const context = await liff_init(liffId);

var isDev = false;
var userId = "";
try {
Expand Down
9 changes: 5 additions & 4 deletions pages/line/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,15 @@ export default function Settings() {
var liffId = "1655168208-29vA01a6";
try {
if (process?.env?.SETTINGS_LIFF_ID) liffId = process.env.SETTINGS_LIFF_ID;
else if (context.type == "none" || context.type == "external") {
} catch { }

const context = await liff_init(liffId);
try {
if (!process?.env?.SETTINGS_LIFF_ID && (context.type == "none" || context.type == "external")) {
alert("請使用正常路徑開啟");
return;
}
} catch { }

const context = await liff_init(liffId);

var isDev = false;
var userId = "";
try {
Expand Down

0 comments on commit e94e78f

Please sign in to comment.