Page MenuHomePhabricator

D8466.id28557.diff
No OneTemporary

D8466.id28557.diff

diff --git a/lib/shared/version-utils.js b/lib/shared/version-utils.js
--- a/lib/shared/version-utils.js
+++ b/lib/shared/version-utils.js
@@ -36,4 +36,31 @@
return true;
}
-export { FUTURE_CODE_VERSION, NEXT_CODE_VERSION, hasMinCodeVersion };
+function hasMinStateVersion(
+ platformDetails: ?PlatformDetails,
+ minStateVersion: $Shape<{ +native: number, +web: number }>,
+): boolean {
+ if (!platformDetails) {
+ return true;
+ }
+ const { stateVersion } = platformDetails;
+ const minVersion = isWebPlatform(platformDetails.platform)
+ ? minStateVersion.web
+ : minStateVersion.native;
+
+ if (!minVersion) {
+ return true;
+ }
+ if (!stateVersion || stateVersion < minVersion) {
+ return false;
+ }
+
+ return true;
+}
+
+export {
+ FUTURE_CODE_VERSION,
+ NEXT_CODE_VERSION,
+ hasMinCodeVersion,
+ hasMinStateVersion,
+};

File Metadata

Mime Type
text/plain
Expires
Thu, Dec 19, 9:51 PM (21 h, 4 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2678527
Default Alt Text
D8466.id28557.diff (863 B)

Event Timeline