Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(uploader): fix chooseImage error in PC #5477

Merged
merged 6 commits into from
Jul 10, 2023

Conversation

johnsonwong666
Copy link
Collaborator

@johnsonwong666 johnsonwong666 requested a review from landluck July 10, 2023 07:46
@@ -1,6 +1,15 @@
import { pickExclude } from '../common/utils';
import { isImageUrl, isVideoUrl } from '../common/validator';

let isRunningOnPC = false;

try {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

全局有一个 getSystemInfoSync 的工具函数,可以直接用,不用自己在写一个了

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isRunningOnPC 简化一下,就叫 isPC 吧,在 utils 里面写个工具函数

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok了

@@ -109,3 +113,8 @@ export function getCurrentPage<T>() {
const pages = getCurrentPages();
return pages[pages.length - 1] as T & WechatMiniprogram.Page.TrivialInstance;
}

export function isPC() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以作为一个场景的,例如 export const isPc = xxx ,没必须要每次使用都重新计算

@landluck landluck changed the title Hotfix/fix issue 5438 fix(uploader): fix chooseImage error in PC Jul 10, 2023
@landluck landluck merged commit 7498ed1 into youzan:dev Jul 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants