-
Notifications
You must be signed in to change notification settings - Fork 826
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
Sketch Welcome Screen #48
Comments
This is still happening to me even after turning off the Welcome Screen |
Does it work if you open a blank document? We have no way of bypassing the Welcome Screen — I've mentioned it to @bomberstudios but we'd need Sketch to help us out :( |
Unfortunately not |
Well that seems like a bigger issue :) Can you try this?
|
Fixed by disabling welcome screen. This should be added to the getting started guide. |
Hi, this seems to solve the issue and bypass the welcome screen: const sketch = require('sketch');
export default () => {
const documents = sketch.getDocuments();
let doc = Array.isArray(documents) && documents.length >= 1 // if there are any open documents
? documents[0] // select the last active document
: new sketch.Document(); // or create a new document
doc = doc.sketchObject;
const data = doc.documentData();
const pages = doc.pages();
render(<DocumentContainer colors={theme.colors} />, data);
data.setCurrentPage(pages.firstObject());
}; Maybe this should be added to the getting started docs? |
I believe you can just do const sketch = require('sketch');
export default () => {
const documents = sketch.getDocuments();
let doc = Array.isArray(documents) && documents.length >= 1 // if there are any open documents
? documents[0] // select the last active document
: new sketch.Document(); // or create a new document
render(<DocumentContainer colors={theme.colors} />, doc);
doc.selectedPage = doc.pages[0] // not sure that's necessary?
}; |
Yes, that works too and is cleaner, thanks. The |
sure! 🙏 |
Small bug when Sketch "Welcome" screen is shown on app start.
Expected behavior:
Rendering should start normally.
Observed behavior:
TypeError: null is not an object (evaluating 'context.document.currentPage')
How to reproduce:
Install Sketch and don't check off "show on every launch" on the "Welcome" screen.
Sketch version:
43.2
The text was updated successfully, but these errors were encountered: