Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3492036
D8466.id28557.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
863 B
Referenced Files
None
Subscribers
None
D8466.id28557.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D8466: [lib] Add hasMinStateVersion
Attached
Detach File
Event Timeline
Log In to Comment